This issue should solve my other issue where I need to update the child libraries content provider: Using build types in Gradle libraries to run same app that uses ContentProvider on one device
I have a product flavor in the root application that is successfully changing the package name so I can deploy different versions of the app. When I try to add the same product flavor in a child library, the build fails because the root application fails to load a java class that is referenced from the child library because now the package name has changed? I thought that product flavors did not effect the java class package structure?
ATCApp.gradle root application
...
dependencies {
...
compile project(':libraries:FYC')
...
}
...
android
{
...
productFlavors
{
prod {
packageName "com.company.android"
}
qa {
packageName "com.company.android.qa"
}
}
}
FYC.gradle child library
...
android
{
...
productFlavors
{
prod {
resValue "string", "authority", "com.company.android.fyc.models.listing.listingprovider"
}
qa {
resValue "string", "authority", "com.company.android.qa.fyc.models.listing.listingprovider"
}
}
}
Adding the above product flavors in the child FYC library causes the root application to throw an error:
/src/main/java/com/company/android/HomeBroadcastReceiver.java:7: package com.company.android.fyc.controllers does not exist import com.company.android.fyc.controllers.FYCHomePagerActivity;
Thanks for any help!