質問

I'm working on my gradle build for an android product to get product flavors working.

I have following project structure:

at.mkw.inlocs.android - Library Project
at.mkw.inlocs.android.lib - Library Project - depends on at.mkw.inlocs.android
at.mkw.inlocs.android.login - App Project - depends on at.mkw.inlocs.android
at.mkw.inlocs.android.core - App Project - depends on at.mkw.inlocs.android.lib
at.mkw.inlocs.android.breeding - App Project - depends on at.mkw.inlocs.android.lib
at.mkw.inlocs.android.localization - App Project - depends on at.mkw.inlocs.android.lib
at.mkw.inlocs.android.health - App Project - depends on at.mkw.inlocs.android.lib

Since adding product flavors to all app and library projects, I am getting an exception when building.

enter image description here

I am using the newest gradle artifact (com.android.tools.build:gradle:0.9+) and android build tools 19.0.3

Another problem is, that Android Studio doesn't show the at.mkw.inlocs.android.lib module in project view.

enter image description here

After switching to packages view, the module is visible, but has no content.

enter image description here

I have pasted the build.gradle files:

root build script

at.mkw.inlocs.android

at.mkw.inlocs.android.lib

at.mkw.inlocs.android.login

at.mkw.inlocs.android.core

at.mkw.inlocs.android.localization

at.mkw.inlocs.android.health

at.mkw.inlocs.android.breeding

役に立ちましたか?

解決

Looking at the build.gradle at.mkw.inlocs.android, you are using flavors in a library project.

While this is fine, current flavor support in library project is not final and by default the variants are not published (for consumption by other projects) due to some limitations.

To enable it you'll need to do

android {
    publishNonDefault true
}

reference: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top