记录Direct local .aar file dependencies are not supported when building an AAR

引用: implementation files("lib/libs-release.aar")
build失败:

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :ui project caused this error: G:\TESTNewCode\TestApp\ui\lib\libs-release.aar

修改:

 implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

这种依赖问题应该是由于环境版本变化导致的,根据错误描述说以前的这种直接依赖方式会破坏aar文件,高版本后不再支持,我们这种解决方式是让library在编译时使编译器通过不报错,在主工程拷贝一份的文件在打包后能让程序正常调用

猜你喜欢

转载自blog.csdn.net/github_37610197/article/details/129045620
今日推荐