Status Update
Comments
ra...@google.com <ra...@google.com>
je...@google.com <je...@google.com>
ko...@gmail.com <ko...@gmail.com> #2
Okay. I tried a bunch of agp+android studio versions
The last working version was classpath("com.android.tools.build:gradle:7.4.0-alpha06")
once I moved to
classpath("com.android.tools.build:gradle:7.4.0-alpha07")
then things start breaking on firebase app dist.
im...@google.com <im...@google.com> #3
Scott, assigning to you as it seem to complain the zip is not aligned while packaging which is very puzzling considering the steps...
ka...@droidsonroids.pl <ka...@droidsonroids.pl> #4
OP, when you build the APK with AGP, are you doing any post-processing on the APK and/or do you have any custom tasks that are modifying the APK?
Can you try to verify the alignment of your APK with zipalign
locally (zipalign
is included in build-tools
):
zipalign -c -v 4 foo.apk
im...@google.com <im...@google.com> #5
Not doing any post processing. No custom tasks. I will try to verify alignment now. Give me a sec.
ko...@gmail.com <ko...@gmail.com> #6
Scenario 1:
built my apk with agp alpha09, but didn't update firebase (bom = 30.2.0)
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification succesful"
Scenario 2:
built my apk with agp alpha09, but I DID update firebase (bom = 30.3.1)
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification FAILED"
im...@google.com <im...@google.com>
am...@google.com <am...@google.com>
am...@google.com <am...@google.com> #7
Scenario 3:
built my apk with agp alpha09, with androidx.splash rc01
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification succesful"
Scenario 4:
built my apk with agp alpha09, with androidx.splash 1.0.0
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification FAILED"
In both failed cases if I do | grep BAD
I get
7216334 junit/runner/logo.gif (BAD - 2)
7217354 junit/runner/smalllogo.gif (BAD - 2)
ko...@gmail.com <ko...@gmail.com> #8
In the cases where zipalign
verification fails, is the APK generated by a clean build (e.g., ./gradlew clean :app:assembleRelease
)?
Does verification succeed if you add this to your build.gradle?
android {
packagingOptions {
exclude 'junit/runner/logo.gif'
exclude 'junit/runner/smalllogo.gif'
}
}
am...@google.com <am...@google.com> #9
In the cases where zipalign verification fails, is the APK generated by a clean build (e.g., ./gradlew clean :app:assembleRelease)?
I clean before i generate the apk using the Android Studio menu for generating an apk
Does verification succeed if you add this to your build.gradle?
I assume it will, but let me try. Any reason why changing from androidx.splash 1.0.0-rc01 to 1.0.0 stable (which is 0 changes. all it changed was the dependency version) that it fails verification. It seems like something else is wrong that's a bit deeper than just adding these two exclude statements.
Description
We've used AGP 4.2.2 in project and all android tests under library modules worked fine. After upgrading AGP to version 7.0.0 (and later 7.0.1) we are not able to compile android tests.
For sample project call: ./gradlew :customView:assembleDebugAndroidTest
Result: > Cannot find resource: id view_1
Expected: Successful compilation
Changing AGP version in sample project to 4.2.2 solves issue.
Missing resource id is used in kotlin code as reference for Espresso.
Build: AI-203.7717.56.2031.7583922, 202107261959,
AI-203.7717.56.2031.7583922, JRE 11.0.10+0-b96-7281165x64 JetBrains s.r.o., OS Mac OS X(x86_64) v10.15.7, screens 2880.0x1800.0, 1920.0x1080.0
AS: Arctic Fox | 2020.3.1; Kotlin plugin: 203-1.5.21-release-328-AS7717.8; Android Gradle Plugin: 4.2.2; Gradle: 7.0.2; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read