美文网首页
添加构建依赖项报错

添加构建依赖项报错

作者: _10_01_ | 来源:发表于2021-07-07 12:06 被阅读0次

    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).

    添加构建依赖项: https://developer.android.google.cn/studio/build/dependencies#remote-repositories

    添加百度地图的AAR时,直接运行没报错,但 ReBuild 时报错,

    implementation fileTree(dir: 'libs', include: ['*.aar'])
    
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))
    

    可以尝试在 map module 中使用 compileOnly,而在 app module 下使用 implementation解决报错。

    参考

    https://blog.csdn.net/yeshennet/article/details/114331818

    相关文章

      网友评论

          本文标题:添加构建依赖项报错

          本文链接:https://www.haomeiwen.com/subject/rfyoultx.html