Fixed
Status Update
Comments
ly...@gmail.com <ly...@gmail.com> #2
Thanks for the report. Would it be possible for you to share a zip dump of the inputs to R8, including the app's class files, keep rules, etc.? This should enable us to reproduce the build.
You can generate this by running:
./gradlew assembleRelease --no-daemon -Dcom.android.tools.r8.dumpinputtodirectory=/path/to/r8/dumps
See also
xo...@google.com <xo...@google.com>
je...@google.com <je...@google.com>
am...@google.com <am...@google.com> #3
Hi, thanks for response, here they are
am...@google.com <am...@google.com> #4
Thanks for sharing. Looking at the code from the dump it is not immediately clear why this would fail with a NullPointerException. Would it be possible for you to also share the APK that is not working?
ly...@gmail.com <ly...@gmail.com> #5
We experience the same problem after we upgraded to Gradle 8. Identical problem as reported in this ticket: with the setActivity call on a session:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
at com.google.android.gms.internal.fitness.zzfv.zza(com.google.android.gms:play-services-fitness@@21.1.0:1)
at com.google.android.gms.fitness.data.Session$Builder.setActivity(com.google.android.gms:play-services-fitness@@21.1.0:1)
It happens for example when invoking:
val session = Session.Builder()
.setDescription("our description")
.setIdentifier("our package name")
.setActivity(FitnessActivities.SLEEP)
.setStartTime(startSleepTime, TimeUnit.MILLISECONDS)
.setEndTime(endSleepTime, TimeUnit.MILLISECONDS)
.build()
We tried it with both with R8 fullMode default enabled and with R8 full mode disabled, but in both cases the error occurs.
We also tested this with JavaVersion.VERSION_1_8 and with JavaVersion.VERSION_17 and in both cases the problem occurs.
In all cases it works fine with a debug build.
We we revert to gradle 7.4.2. the problem disappears.
Please let me know how we can help you with additional information.
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
at com.google.android.gms.internal.fitness.zzfv.zza(com.google.android.gms:play-services-fitness@@21.1.0:1)
at com.google.android.gms.fitness.data.Session$Builder.setActivity(com.google.android.gms:play-services-fitness@@21.1.0:1)
It happens for example when invoking:
val session = Session.Builder()
.setDescription("our description")
.setIdentifier("our package name")
.setActivity(FitnessActivities.SLEEP)
.setStartTime(startSleepTime, TimeUnit.MILLISECONDS)
.setEndTime(endSleepTime, TimeUnit.MILLISECONDS)
.build()
We tried it with both with R8 fullMode default enabled and with R8 full mode disabled, but in both cases the error occurs.
We also tested this with JavaVersion.VERSION_1_8 and with JavaVersion.VERSION_17 and in both cases the problem occurs.
In all cases it works fine with a debug build.
We we revert to gradle 7.4.2. the problem disappears.
Please let me know how we can help you with additional information.
je...@google.com <je...@google.com> #6
Would it be possible for you to share a small project that reproduces this?
The dump shared in
cm...@google.com <cm...@google.com>
am...@google.com <am...@google.com> #7
(I'm not the original poster) I made phone dump just after the crash, I'm not sure if this will help. I don't want to share it here, because then others can download it too. If you want the phone dump log, then please let me know how to share it with you.
A small project reproducing this issue is difficult, it requires the Google Fit integration.
I'm trying to create the code dumps for a release build, but I never use the gradlew command line and it runs with some errors, that I'm not familiar with. I will try it in another way.
A small project reproducing this issue is difficult, it requires the Google Fit integration.
I'm trying to create the code dumps for a release build, but I never use the gradlew command line and it runs with some errors, that I'm not familiar with. I will try it in another way.
cm...@google.com <cm...@google.com> #8
Hi, in the Test1App.zip a very small project. Runs well when compiling as debug, the nullpointer exception occurs when running as release build. The only thing that it does is creating a Google Fit session with Sleep as activity (but it happens also with other activity types).
Please let me know if you need more information.
Please let me know if you need more information.
sp...@google.com <sp...@google.com> #9
Project: r8
Branch: main
commit 6c720a541af1562d61ccb0cf0727df6da0d22ba6
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:15:30 2023
Fix removal of live array-puts in presence of Assume instruction
Bug: b/280659987
Change-Id: Ief4e51fcccba7e777f57efe9377ab20e89ca0554
M src/main/java/com/android/tools/r8/ir/code/ArrayPut.java
M src/test/java/com/android/tools/r8/rewrite/arrays/ArrayPutsToArrayAliasTest.java
https://r8-review.googlesource.com/79347
Branch: main
commit 6c720a541af1562d61ccb0cf0727df6da0d22ba6
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:15:30 2023
Fix removal of live array-puts in presence of Assume instruction
Bug:
Change-Id: Ief4e51fcccba7e777f57efe9377ab20e89ca0554
M src/main/java/com/android/tools/r8/ir/code/ArrayPut.java
M src/test/java/com/android/tools/r8/rewrite/arrays/ArrayPutsToArrayAliasTest.java
xa...@google.com <xa...@google.com> #10
Project: r8
Branch: main
commit bed41a13debd0875e508353cf79c33c751e49a22
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:01:26 2023
Reproduce removal of live array-puts in presence of Assume instruction
Bug: b/280659987
Change-Id: I2bb641c28d6b107db2f3daefd4e7fedcf85cbde9
A src/test/java/com/android/tools/r8/rewrite/arrays/ArrayPutsToArrayAliasTest.java
https://r8-review.googlesource.com/79346
Branch: main
commit bed41a13debd0875e508353cf79c33c751e49a22
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:01:26 2023
Reproduce removal of live array-puts in presence of Assume instruction
Bug:
Change-Id: I2bb641c28d6b107db2f3daefd4e7fedcf85cbde9
A src/test/java/com/android/tools/r8/rewrite/arrays/ArrayPutsToArrayAliasTest.java
cm...@google.com <cm...@google.com> #11
Project: r8
Branch: 8.0
commit 6392f0ec0142bd168635cb7b8b7610b343679288
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:28:06 2023
Version 8.0.46
Bug: b/280659987
Change-Id: I98398113ef7db1971e7f91cddf0227d80f715313
M src/main/java/com/android/tools/r8/Version.java
https://r8-review.googlesource.com/79351
Branch: 8.0
commit 6392f0ec0142bd168635cb7b8b7610b343679288
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:28:06 2023
Version 8.0.46
Bug:
Change-Id: I98398113ef7db1971e7f91cddf0227d80f715313
M src/main/java/com/android/tools/r8/Version.java
ry...@gmail.com <ry...@gmail.com> #12
Project: r8
Branch: 8.0
commit b7985cfb00840d9997e05eb5fa5084df2a7699c4
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:28:00 2023
Fix removal of live array-puts in presence of Assume instruction
Bug: b/280659987
Change-Id: Ief4e51fcccba7e777f57efe9377ab20e89ca0554
M src/main/java/com/android/tools/r8/ir/code/ArrayPut.java
M src/test/java/com/android/tools/r8/rewrite/arrays/ArrayPutsToArrayAliasTest.java
https://r8-review.googlesource.com/79350
Branch: 8.0
commit b7985cfb00840d9997e05eb5fa5084df2a7699c4
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed May 10 11:28:00 2023
Fix removal of live array-puts in presence of Assume instruction
Bug:
Change-Id: Ief4e51fcccba7e777f57efe9377ab20e89ca0554
M src/main/java/com/android/tools/r8/ir/code/ArrayPut.java
M src/test/java/com/android/tools/r8/rewrite/arrays/ArrayPutsToArrayAliasTest.java
Description
DESCRIBE THE ISSUE IN DETAIL: Assume we have one module A, that declares permission with manifest placeholder:
Also we have another module B that have dependency on module A. This module has some unit tests and enabled
android.testOptions.unitTests.includeAndroidResources = true
inbuild.gradle
. To run unit tests I need to declare manifest placeholder for test variants in module B inbuild.gradle
:When I'm trying to run unit tests in module B I'm getting the error:
But it works correctly with AGP 7.3.1.
Sample project to reproduce:https://github.com/bacecek/sample-checking-assistant-role/tree/broken-test-manifest-placeholders
Studio Build: Android Studio Electric Eel | 2022.1.1. Build #AI-221.6008.13.2211.9477386, built on January 11, 202 Version of Gradle Plugin: 7.4.0 Version of Gradle: 7.5.1 Version of Java: Temurin 17.0.5 OS: macOS 13.1