Android Studio 3.0 submodule compile failed

六眼飞鱼酱① 提交于 2019-12-22 10:54:08

问题


App level build gradle dependencies

devCompile project(path: ':mymodule', configuration: 'devRelease')
proCompile project(path: ':mymodule', configuration: 'proRelease')
qaCompile project(path: ':mymodule', configuration: 'qaRelease')
offlineCompile project(path: ':mymodule', configuration: 'offlineRelease')

mentioned

publishNonDefault true
flavorDimensions "default"

I have tried This accepted answer but didn't work.

Update: Look at the library gradle flavor that I want to compile. I have the same flavor mentioned in my app's Module.

        dev {
            manifestPlaceholders = [facebookId: "SOME_FACEBOOK_ID_1"]
        }
        pro {
            manifestPlaceholders = [facebookId: "SOME_FACEBOOK_ID_2"]
        }
        qa {
            manifestPlaceholders = [facebookId: "SOME_FACEBOOK_ID_3"]
        }
        offline {
            manifestPlaceholders = [facebookId: "SOME_FACEBOOK_ID_4"]
        }

回答1:


You just need to reduce the details you provide:

compile project(path: ':mymodule')

The details what in which configuration is decided by gradle now by themselves. So it became way easier. Instead of 4 lines you just need the above now.

Also remove the publishNonDefault true from your modules gradle. It is not needed anymore.




回答2:


Dependency management between modules has changed since Android Gradle Plugin 3.0.0. It automatically tries to matches flavours between your app and the libraries/modules it depends on.

See the documentation for more explanation!



来源:https://stackoverflow.com/questions/47215663/android-studio-3-0-submodule-compile-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!