Fixed
Status Update
Comments
a....@gmail.com <a....@gmail.com> #2
Same here. I have links in a local html file referencing file:///android_res/drawable/ and on all gradle build flavors using another applicationId (added suffix) the Webview only shows broken links.
This behaviour seems not to be connected solely to Android 5.0 since it occurs on Android 4.4.4 too (tested with current cyanogenmod 11 build).
This behaviour seems not to be connected solely to Android 5.0 since it occurs on Android 4.4.4 too (tested with current cyanogenmod 11 build).
je...@google.com <je...@google.com>
[Deleted User] <[Deleted User]> #3
As a hotfix I added the following code to the gradle buildscript, which generates an additional R.java with changed java package for every flavor. I don't like this solution though.
android.applicationVariants.all{ variant ->
variant.javaCompile.doFirst{
copy {
from "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/R.java"
into "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${variant.buildType.name }/"
}
File rFile = file("${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${variant.buildType.name }/R.java")
String content = rFile.getText('UTF-8')
String newPackageName = "com.example.application.${variant.buildType.name }";
content = content.replaceAll(/com.example.application/, newPackageName)
rFile.write(content, 'UTF-8')
}
}
android.applicationVariants.all{ variant ->
variant.javaCompile.doFirst{
copy {
from "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/R.java"
into "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${
}
File rFile = file("${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${
String content = rFile.getText('UTF-8')
String newPackageName = "com.example.application.${
content = content.replaceAll(/com.example.application/, newPackageName)
rFile.write(content, 'UTF-8')
}
}
Description
Java 1.8.0_45
Gradle: 2.14.1
Android SDK Tools 25.2.2
Build tools 23.0.3
Compile SDK 23
com.android.tools.build:gradle:2.2.0
com.android.support:support-v4:23.4.0
Repo:
This project has a module named "app" with a compile dependency on a module named "library" and a testCompile dependency on a module named "testlibrary". The testlibrary module has a compile dependency on the library module and the library module has a compile dependency on support-v4. Running ./gradlew clean :app:testDebug results in the following error:
File '...testlibrary/build/outputs/aar/testlibrary-release.aar' specified for property 'bundle' does not exist.
testlibrary-release.aar should be generated by :testlibrary:bundleRelease. Normally :app:prepareAndroidBundleBugTestlibraryUnspecifiedLibrary would depend on :testlibrary: bundleRelease but it does not.
This works:
./gradlew clean :testlibrary:bundleRelease && ./gradlew :app:testDebug
As does making any one of the following changes:
- Downgrade com.android.tools.build:gradle.
- Remove the dep on support-v4.
- Remove the compile dependency between the app and library modules.
- Remove the compile dependency between the testlibrary and library modules.