Status Update
Comments
ks...@google.com <ks...@google.com>
la...@google.com <la...@google.com> #2
Retraced stack trace:
Caused by: java.lang.NullPointerException: (No message provided)
at com.android.tools.r8.utils.collections.IdentityHashSetFromMap.lambda$newProgramDerivedContextSet$0(IdentityHashSetFromMap.java:26)
at com.android.tools.r8.utils.collections.IdentityHashSetFromMap.add(IdentityHashSetFromMap.java:62)
at com.android.tools.r8.shaking.MissingClasses$Builder.rewriteMissingClassContextsForSingleMissingClass(MissingClasses.java:214)
at com.android.tools.r8.shaking.MissingClasses$Builder.rewriteMissingClassContexts(MissingClasses.java:171)
at com.android.tools.r8.shaking.MissingClasses$Builder.getMissingClassesToBeReported(MissingClasses.java:233)
at com.android.tools.r8.shaking.MissingClasses$Builder.reportMissingClasses(MissingClasses.java:135)
at com.android.tools.r8.shaking.Enqueuer.createEnqueuerResult(Enqueuer.java:3767)
at com.android.tools.r8.shaking.Enqueuer.traceApplication(Enqueuer.java:3242)
at com.android.tools.r8.R8.runEnqueuer(R8.java:1026)
at com.android.tools.r8.R8.run(R8.java:382)
at com.android.tools.r8.R8.run(R8.java:265)
at com.android.tools.r8.R8.lambda$runForTesting$1(R8.java:256)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:80)
at com.android.tools.r8.utils.ExceptionUtils.withR8CompilationHandler(ExceptionUtils.java:69)
at com.android.tools.r8.R8.runForTesting(R8.java:252)
at com.android.tools.r8.R8.run(R8.java:190)
be...@gmail.com <be...@gmail.com> #3
Would it be possible for you to share a zip containing the inputs given to the compiler to allow reproducing this? You can generate such a dump by issuing the command ./gradlew assembleRelease --no-daemon -Dcom.android.tools.r8.dumpinputtodirectory=/path/to/dumps
. See also
You can share this privately with
be...@gmail.com <be...@gmail.com> #4
A dump has been shared with both of you!
la...@google.com <la...@google.com> #5
Branch: main
commit a866fef498691f5193dc923a8965c8a6f6aded10
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 14:55:28 2022
Fix NPE from rewriting of missing classes contexts
Bug:
Change-Id: Ib9d194d870ba79be2f8f704666100388fc8d0db7
M src/main/java/com/android/tools/r8/shaking/MissingClasses.java
la...@google.com <la...@google.com> #6
Nice! Let me know which release I can test it against. Is it going into the 3.2.x branch?
gf...@google.com <gf...@google.com> #8
Branch: 3.3
commit 03af92b0a390d7ce622e5554a7315edeb4421d1c
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:32:59 2022
Fix NPE from rewriting of missing classes contexts
Bug:
Change-Id: Ib9d194d870ba79be2f8f704666100388fc8d0db7
M src/main/java/com/android/tools/r8/shaking/MissingClasses.java
be...@gmail.com <be...@gmail.com> #9
Branch: 3.2
commit e63b2dac1dfd5ea22e3ec5e26fcb5534a4836c22
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:34:57 2022
Version 3.2.71
Bug:
Change-Id: Ic46f2a5a677408946de06c99e549d7f3e80f9282
M src/main/java/com/android/tools/r8/Version.java
be...@gmail.com <be...@gmail.com> #10
Branch: 3.2
commit e55131270b332d032c15cc067718fd348784bd86
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:34:20 2022
Fix NPE from rewriting of missing classes contexts
Bug:
Change-Id: Ib9d194d870ba79be2f8f704666100388fc8d0db7
M src/main/java/com/android/tools/r8/shaking/MissingClasses.java
jo...@google.com <jo...@google.com> #11
Branch: 3.1
commit 659ad95323dcda252c852b47817ec946d379c625
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:35:52 2022
Version 3.1.80
Bug:
Change-Id: I4eff1308d96a600cb816d4b610e1e5cf17e0c5c8
M src/main/java/com/android/tools/r8/Version.java
xa...@google.com <xa...@google.com> #14
Branch: 3.2
commit e55131270b332d032c15cc067718fd348784bd86
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:34:20 2022
Fix NPE from rewriting of missing classes contexts
Bug:
Change-Id: Ib9d194d870ba79be2f8f704666100388fc8d0db7
M src/main/java/com/android/tools/r8/shaking/MissingClasses.java
je...@gmail.com <je...@gmail.com> #15
Branch: 3.3
commit 03af92b0a390d7ce622e5554a7315edeb4421d1c
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:32:59 2022
Fix NPE from rewriting of missing classes contexts
Bug:
Change-Id: Ib9d194d870ba79be2f8f704666100388fc8d0db7
M src/main/java/com/android/tools/r8/shaking/MissingClasses.java
Je...@envrmnt.com <Je...@envrmnt.com> #16
The fix should now be in R8 3.1.80, 3.2.71 and 3.3.63.
You can build with any R8 release version by adding the following to settings.gradle
.
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:3.2.71")
}
}
}
em...@google.com <em...@google.com> #17
Thank you! I've verified that the fix works, but unfortunately it uncovered a secondary issue, which I'll open a separate bug report for.
so...@google.com <so...@google.com>
sm...@google.com <sm...@google.com>
em...@google.com <em...@google.com> #18
Branch: main
commit 9d1c3c24d90d1aefc6aa4b71a9f0733d6ccda6fe
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Jun 22 15:30:42 2022
Reproduce NPE from rewriting of missing classes contexts
Bug:
Change-Id: I66df15e802f060b2c58679455eb328022f30cdb7
A src/test/java/com/android/tools/r8/missingclasses/MissingClassReferencedFromForcefullyMovedMethodTest.java
M src/test/java/com/android/tools/r8/missingclasses/MissingClassesTestBase.java
ve...@google.com <ve...@google.com> #19
Scenario-1:
1. Release Version abi's are displaying in debug apk too.
Scenario-2:
1. While trying to debug the sample project with breakpoints in both library and app modules , App is crashed with java.lang.UnsatisfiedLinkError
stack trace:
2022-07-27 14:28:20.537 7370-7370/com.example.hellojni E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.hellojni, PID: 7370
java.lang.UnsatisfiedLinkError: dlopen failed: library "libhello-jni.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
at java.lang.Runtime.loadLibrary0(Runtime.java:998)
at java.lang.System.loadLibrary(System.java:1656)
at com.example.hellojni.HelloJni.<clinit>(HelloJni.java:59)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1285)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3578)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3842)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
em...@google.com <em...@google.com> #20
If the issue reproduces in Chipmunk Patch 2, we need more detailed instructions on how to reproduce it. This bug diverged from its original title, so I suggest filing a separate bug, and include full instructions on how to create a project that reproduces it, or even better, attach a project that reproduces the issue (or issues).
Based on my efforts to reproduce using Chipmunk Patch 2, debugging (with app=non-native, lib=native) works, and no UnsatisfiedLinkError
s are observed.
dy...@gmail.com <dy...@gmail.com> #22
dy...@gmail.com <dy...@gmail.com> #23
cl...@gmail.com <cl...@gmail.com> #24
ka...@gmail.com <ka...@gmail.com> #25
Android 13
ka...@gmail.com <ka...@gmail.com> #26
Funtouch os13
Description
Setup. 2 projects `app` project and `libModule`. This bug has 2 parts which I think are related so I'm putting both parts here.
**Part 1:** Can't debug library project, setting breakpoints do not work. And when a segfault happens ndk breaks in "unknown function` and nothing useful can be done.
A workaround solution is in the main project do this:
```
// default config
externalNativeBuild {
cmake {
abiFilters'armeabi-v7a'
arguments "-DANDROID_PLATFORM=android-${platformVersion}",
'-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_shared'
}
}
// in android {}
externalNativeBuild {
cmake {
path "../libModule/src/main/cpp/CMakeLists.txt"
}
}
```
and I can debug just fine. So far it's fine. This has the disadvantage of compiling everything twice.
**part 2:** Library project always compiles in the release folder `.externalNativeBuild` regardless what has been specified. Interesting though if I do "Build->build APK" in android studio RC2 it builds the debug build.
Some discussion [here](
Some version specifiers
```
Android Studio 2.2 RC 2
Build #AI-145.3253452, built on September 7, 2016
JRE: 1.8.0_76-release-b03 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
classpath 'com.android.tools.build:gradle:2.2.0-rc2'
compileSdkVersion 24
buildToolsVersion "24.0.2"
cmake {
abiFilters'armeabi-v7a'
arguments "-DANDROID_PLATFORM=android-19",
'-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_shared'
}
```
Studio Build: RC2
Version of Gradle Plugin: 2.2.0-rc2
Version of Gradle: 2.14.1
Version of Java: 8
OS: Mac
Steps to Reproduce: make a project with app & module. Module is C++ with cmake. Put breakpoint in C++ code or have C++ code purposely crash. Try debugging. You can't debug.