Fixed
Status Update
Comments
mk...@google.com <mk...@google.com> #2
Can I ask you to try and run with --info and --stacktrace to let us see the full stack trace and error.
aw...@gtempaccount.com <aw...@gtempaccount.com> #3
Result of following command attached:
$ ./gradlew --info --stacktrace build >buildlog.txt 2>&1
$ ./gradlew --info --stacktrace build >buildlog.txt 2>&1
ze...@google.com <ze...@google.com> #4
This could very likely be a dup of b/150330356
Could you try amending you top-level build.gradle with the below and see if that resolved the NPE error:
buildscript {
repositories {
maven {
url 'https://storage.googleapis.com/r8-releases/raw '
}
}
dependencies {
classpath 'com.android.tools:r8:1.6.78' // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
}
Could you try amending you top-level build.gradle with the below and see if that resolved the NPE error:
buildscript {
repositories {
maven {
url '
}
}
dependencies {
classpath 'com.android.tools:r8:1.6.78' // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
}
aw...@gtempaccount.com <aw...@gtempaccount.com> #5
As mentioned in the description of this issue, I've already tried that solution and still get the NPE error.
" I've tried the builds mentioned in the following comments of another ticket and they all give the above error as well:
-https://issuetracker.google.com/issues/150330356#comment16
-https://issuetracker.google.com/issues/150330356#comment26 "
" I've tried the builds mentioned in the following comments of another ticket and they all give the above error as well:
-
-
ze...@google.com <ze...@google.com> #6
Thanks for the update. I had not notices the comment about those attempts. Could you try running the attached r8.jar from b/150330356#comment8
That should provide the actual point of the NPE which may not be the same switch issue.
That should provide the actual point of the NPE which may not be the same switch issue.
ze...@google.com <ze...@google.com> #7
Also, if possible to share the classfile inputs to the program, you could make a dump as detailed in b/150330356#comment6 and attach it here or share it privately with zerny@google.com and/or mkroghj@google.com
With that we should be able to reproduce locally.
With that we should be able to reproduce locally.
aw...@gtempaccount.com <aw...@gtempaccount.com> #8
Here's the build log with the r8.jar. Please let me know if it helps. Thanks.
ze...@google.com <ze...@google.com> #9
Thanks! The log shows this is not a dup (as your trials with the other builds showed). The relevant stacktrace is:
Caused by: java.lang.NullPointerException
at com.android.tools.r8.ir.code.IRCode.computeNormalExitBlocks(IRCode.java:888)
at com.android.tools.r8.ir.optimize.CodeRewriter.identifyReturnsArgument(CodeRewriter.java:1160)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCodeInternal(IRConverter.java:1418)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCode(IRConverter.java:1043)
at com.android.tools.r8.ir.conversion.IRConverter.processMethod(IRConverter.java:1020)
at com.android.tools.r8.ir.conversion.IRConverter.lambda$optimize$6(IRConverter.java:662)
at com.android.tools.r8.ir.conversion.MethodProcessor.lambda$forEachMethod$2(MethodProcessor.java:108)
Caused by: java.lang.NullPointerException
at com.android.tools.r8.ir.code.IRCode.computeNormalExitBlocks(IRCode.java:888)
at com.android.tools.r8.ir.optimize.CodeRewriter.identifyReturnsArgument(CodeRewriter.java:1160)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCodeInternal(IRConverter.java:1418)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCode(IRConverter.java:1043)
at com.android.tools.r8.ir.conversion.IRConverter.processMethod(IRConverter.java:1020)
at com.android.tools.r8.ir.conversion.IRConverter.lambda$optimize$6(IRConverter.java:662)
at com.android.tools.r8.ir.conversion.MethodProcessor.lambda$forEachMethod$2(MethodProcessor.java:108)
ze...@google.com <ze...@google.com> #10
Attached is another patched version of R8. Could you run that and post the error message. It should print the code block for which this happens.
Thanks!
Thanks!
aw...@gtempaccount.com <aw...@gtempaccount.com> #11
Sure, attached.
ch...@google.com <ch...@google.com> #12
Thanks. It seems that the error is happening while optimizing the method
int com.penthera.virtuososdk.download.DownloaderImpl$n.a(com.penthera.virtuososdk.internal.interfaces.IEngVSegmentedFile, com.penthera.virtuososdk.internal.interfaces.IEngVirtuosoFileSegment, int, java.util.concurrent.atomic.AtomicBoolean)
Found it here:
Could you please try to build with the following command, which should enable extensive logging during the optimization of that method, and share the logs here:
./gradlew assembleRelease -Dcom.android.tools.r8.extensiveLoggingFilter="int com.penthera.virtuososdk.download.DownloaderImpl\$n.a(com.penthera.virtuososdk.internal.interfaces.IEngVSegmentedFile, com.penthera.virtuososdk.internal.interfaces.IEngVirtuosoFileSegment, int, java.util.concurrent.atomic.AtomicBoolean)" --no-daemon
aw...@gtempaccount.com <aw...@gtempaccount.com> #13
Attached.
ze...@google.com <ze...@google.com> #14
Thanks for providing the log! We have identified the cause which is an off by one error. I'll post back here as soon as we have a fix you can try out.
ap...@google.com <ap...@google.com> #15
Project: r8
Branch: master
commit 87596354ccfc17c8957b1f994f57e7efcbd99df6
Author: Ian Zerny <zerny@google.com>
Date: Fri Mar 06 08:57:53 2020
Fix count error in IdempotentFunctionCallCanonicalizer
Bug: 150688800
Change-Id: I80596d0889db6d2577409438268c75640653f247
M src/main/java/com/android/tools/r8/ir/optimize/IdempotentFunctionCallCanonicalizer.java
A src/test/java/com/android/tools/r8/regress/b150688800/IdempotentCountErrorTest.java
https://r8-review.googlesource.com/49531
Branch: master
commit 87596354ccfc17c8957b1f994f57e7efcbd99df6
Author: Ian Zerny <zerny@google.com>
Date: Fri Mar 06 08:57:53 2020
Fix count error in IdempotentFunctionCallCanonicalizer
Bug: 150688800
Change-Id: I80596d0889db6d2577409438268c75640653f247
M src/main/java/com/android/tools/r8/ir/optimize/IdempotentFunctionCallCanonicalizer.java
A src/test/java/com/android/tools/r8/regress/b150688800/IdempotentCountErrorTest.java
ap...@google.com <ap...@google.com> #16
Project: r8
Branch: 1.6
commit af6558a20601121ab08cb5c1a6aae78d564a7eac
Author: Ian Zerny <zerny@google.com>
Date: Fri Mar 06 09:31:16 2020
Version 1.6.81
Cherry pick: Fix count error in IdempotentFunctionCallCanonicalizer
CL:https://r8-review.googlesource.com/c/r8/+/49531
Bug: 150688800
Change-Id: I4eb6f94a5bdabbc7fd6a5e0cb6cb721304aeea50
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/ir/optimize/IdempotentFunctionCallCanonicalizer.java
A src/test/java/com/android/tools/r8/regress/b150688800/IdempotentCountErrorTest.java
https://r8-review.googlesource.com/49532
Branch: 1.6
commit af6558a20601121ab08cb5c1a6aae78d564a7eac
Author: Ian Zerny <zerny@google.com>
Date: Fri Mar 06 09:31:16 2020
Version 1.6.81
Cherry pick: Fix count error in IdempotentFunctionCallCanonicalizer
CL:
Bug: 150688800
Change-Id: I4eb6f94a5bdabbc7fd6a5e0cb6cb721304aeea50
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/ir/optimize/IdempotentFunctionCallCanonicalizer.java
A src/test/java/com/android/tools/r8/regress/b150688800/IdempotentCountErrorTest.java
ap...@google.com <ap...@google.com> #17
Project: r8
Branch: 2.0
commit cb14ff69f90a698fe30bd8d654d64f332fd6c71e
Author: Ian Zerny <zerny@google.com>
Date: Fri Mar 06 09:44:17 2020
Version 2.0.45
Cherry pick: Fix count error in IdempotentFunctionCallCanonicalizer
CL:https://r8-review.googlesource.com/c/r8/+/49532
Bug: 150688800
Change-Id: I4ee383613c7d8a20e609a3da28a4e3435ec47255
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/ir/optimize/IdempotentFunctionCallCanonicalizer.java
A src/test/java/com/android/tools/r8/regress/b150688800/IdempotentCountErrorTest.java
https://r8-review.googlesource.com/49533
Branch: 2.0
commit cb14ff69f90a698fe30bd8d654d64f332fd6c71e
Author: Ian Zerny <zerny@google.com>
Date: Fri Mar 06 09:44:17 2020
Version 2.0.45
Cherry pick: Fix count error in IdempotentFunctionCallCanonicalizer
CL:
Bug: 150688800
Change-Id: I4ee383613c7d8a20e609a3da28a4e3435ec47255
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/ir/optimize/IdempotentFunctionCallCanonicalizer.java
A src/test/java/com/android/tools/r8/regress/b150688800/IdempotentCountErrorTest.java
ze...@google.com <ze...@google.com> #18
A fix for this has landed in 1.6.81. Could you try out and see if it resolves the issue for your build?
Amend you top-level build.gradle with:
buildscript {
repositories {
maven {
url 'https://storage.googleapis.com/r8-releases/raw ' // NOTICE: no '/master' here!
}
}
dependencies {
classpath 'com.android.tools:r8:1.6.81' // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
}
Amend you top-level build.gradle with:
buildscript {
repositories {
maven {
url '
}
}
dependencies {
classpath 'com.android.tools:r8:1.6.81' // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
}
aw...@gtempaccount.com <aw...@gtempaccount.com> #19
Fixed. Thanks!
ze...@google.com <ze...@google.com> #20
Awesome. Thanks again for reporting and for iterating with us to find the cause!
Description
=== LOG ==============
$ ./gradlew clean build
...
... <<snip>>
...
> Task :app:minifyReleaseWithR8
R8: Library class android.test.AndroidTestCase extends program class junit.framework.TestCase
R8: Library class android.test.AndroidTestRunner extends program class junit.runner.BaseTestRunner
R8: Library class android.test.InstrumentationTestCase extends program class junit.framework.TestCase
R8: Library class android.test.InstrumentationTestSuite extends program class junit.framework.TestSuite
/Users/awardak/.gradle/caches/transforms-2/files-2.1/fef1474bbb7e9b673f1d467589f0ef14/jetified-cnc-android-sdk-3.15.9-runtime.jar: R8: NullPointerException during IR Conversion
> Task :app:minifyReleaseWithR8 FAILED
====================
I've tried the builds mentioned in the following comments of another ticket and they all give the above error as well:
-
-