Can't Repro
Status Update
Comments
uc...@google.com <uc...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #3
Thank you for the report Marlene. Can you please upload a sample project that reproduces the issue?
[Deleted User] <[Deleted User]> #4
"Can you please upload a sample project that reproduces the issue?"
Unfortunately I cant. the project I am working on is not mine to upload. It is company property.
All i'm doing is that I'm initializing FirebaseAnalytics instance in my application class, surrounded by a try/catch. The error is thrown on the catch line.
try {
if(mFirebaseAnalytics == null) {
mFirebaseAnalytics = FirebaseAnalytics.getInstance(getApplicationContext());
}
}
catch (Throwable t)
{
t.printStackTrace();
}
I am also using multidexing.
I am using library version 1.0.1, have multidexing enabled in my gradle files and extending MultidexApplication in my Application class.
I also have a multidexing config file defined and I tried to add the missing class to it (so it would keep the missing class in the main dex file) but that did not work either.
What i'm noticing too is that if I switch between running the app on the 4.1.2 phone and the 6.0 phone without cleaning my build between them, then the error happens. but if I clean the build, and uninstall any previous versions of the app from the phone and then run it, then there are no errors.
The error I'm seeing on The android 6.0 phone is different. I didn't mention it before because I don't know if it's relevant to this bug but here it is:
FATAL EXCEPTION: main
Process: com.app.ott, PID: 21849
java.lang.RuntimeException: Unable to get provider com.google.firebase.perf.provider.FirebasePerfProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.perf.provider.FirebasePerfProvider" on path: DexPathList[[zip file "/data/app/com.app.ott-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.ott-1/lib/arm, /data/app/com.app.ott-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.perf.provider.FirebasePerfProvider" on path: DexPathList[[zip file "/data/app/com.app.ott-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.ott-1/lib/arm, /data/app/com.app.ott-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.installProvider(ActivityThread.java:5162)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Suppressed: java.lang.ClassNotFoundException: com.google.firebase.perf.provider.FirebasePerfProvider
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
I hope thats helpful.
Unfortunately I cant. the project I am working on is not mine to upload. It is company property.
All i'm doing is that I'm initializing FirebaseAnalytics instance in my application class, surrounded by a try/catch. The error is thrown on the catch line.
try {
if(mFirebaseAnalytics == null) {
mFirebaseAnalytics = FirebaseAnalytics.getInstance(getApplicationContext());
}
}
catch (Throwable t)
{
t.printStackTrace();
}
I am also using multidexing.
I am using library version 1.0.1, have multidexing enabled in my gradle files and extending MultidexApplication in my Application class.
I also have a multidexing config file defined and I tried to add the missing class to it (so it would keep the missing class in the main dex file) but that did not work either.
What i'm noticing too is that if I switch between running the app on the 4.1.2 phone and the 6.0 phone without cleaning my build between them, then the error happens. but if I clean the build, and uninstall any previous versions of the app from the phone and then run it, then there are no errors.
The error I'm seeing on The android 6.0 phone is different. I didn't mention it before because I don't know if it's relevant to this bug but here it is:
FATAL EXCEPTION: main
Process: com.app.ott, PID: 21849
java.lang.RuntimeException: Unable to get provider com.google.firebase.perf.provider.FirebasePerfProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.perf.provider.FirebasePerfProvider" on path: DexPathList[[zip file "/data/app/com.app.ott-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.ott-1/lib/arm, /data/app/com.app.ott-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.perf.provider.FirebasePerfProvider" on path: DexPathList[[zip file "/data/app/com.app.ott-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.ott-1/lib/arm, /data/app/com.app.ott-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.installProvider(ActivityThread.java:5162)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Suppressed: java.lang.ClassNotFoundException: com.google.firebase.perf.provider.FirebasePerfProvider
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
I hope thats helpful.
ga...@google.com <ga...@google.com> #5
I am having trouble reproducing the issue. I have tried with a project created from Android Studio, with legacy multidex, and that following application class runs successfully on all devices:
public class MyApplication extends MultiDexApplication {
@Override
public void onCreate() {
super.onCreate();
try {
throw new RuntimeException("log this");
} catch (Throwable t) {
t.printStackTrace();
}
}
}
Can you try to create a new project in Android Studio, and try to copy relevant parts of build files from the original project until the issue is reproducible? That would avoid sharing any sensitive information.
public class MyApplication extends MultiDexApplication {
@Override
public void onCreate() {
super.onCreate();
try {
throw new RuntimeException("log this");
} catch (Throwable t) {
t.printStackTrace();
}
}
}
Can you try to create a new project in Android Studio, and try to copy relevant parts of build files from the original project until the issue is reproducible? That would avoid sharing any sensitive information.
[Deleted User] <[Deleted User]> #6
i don't think that will actually reproduce the issue if there aren't enough methods to go over the 65k limit, but I will try. There are other ways to reproduce the issue as mentioned on this thread https://issuetracker.google.com/issues/64527520 . I will keep you posted on what I find.
va...@gmail.com <va...@gmail.com> #7
In plugin 3.1.0 I see that assembling releaseAndroidTest fails with
"Warning: junit.runner.BaseTestRunner: can't find referenced class com.google.devtools.build.android.desugar.runtime.ThrowableExtension"
it can be related...
"Warning: junit.runner.BaseTestRunner: can't find referenced class com.google.devtools.build.android.desugar.runtime.ThrowableExtension"
it can be related...
va...@gmail.com <va...@gmail.com> #8
Adding dontwarn key into proguard file fixes release testing for me:
-dontwarn com.google.devtools.build.android.desugar.runtime.**
-dontwarn com.google.devtools.build.android.desugar.runtime.**
ga...@google.com <ga...@google.com> #9
Re #6:
Main cause forhttps://issuetracker.google.com/issues/64527520 was that we would desugar try-with-resources, but would not package runtime classes necessary for the support. That has been fixed since, and I am unable to reproduce the issue following those steps.
From your messages in #1 and #4, it seems com.google.devtools.build.android.desugar.runtime.ThrowableExtension is completely missing from the APK. Can you please confirm (you should be able to use the APK analyzer in Android Studio for this).
Following that, can you please check if task "extractTryWithResourcesSupportJar" exists, and check the content of $APP/build/intermediates/processing-tools/runtime-deps?
Re #8:
Thanks for the report Valentin. This is a separate issue, where the Desugar runtime classes are not added as -libraryjars in the Proguard configuration. I've created a new bug, please track progress athttps://issuetracker.google.com/77785017 .
Main cause for
From your messages in #1 and #4, it seems com.google.devtools.build.android.desugar.runtime.ThrowableExtension is completely missing from the APK. Can you please confirm (you should be able to use the APK analyzer in Android Studio for this).
Following that, can you please check if task "extractTryWithResourcesSupportJar" exists, and check the content of $APP/build/intermediates/processing-tools/runtime-deps?
Re #8:
Thanks for the report Valentin. This is a separate issue, where the Desugar runtime classes are not added as -libraryjars in the Proguard configuration. I've created a new bug, please track progress at
[Deleted User] <[Deleted User]> #10
Re #9:
My steps to repo issue:
1) Clean build
2) Run app on Android 6 device (Moto G)
3) Unplug Android 6 device and connect Android 4.1.2 device (LG)
4) Install apk on android 4.1.2 device. I see this warning first:
"unable to resolve static method 54169: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;.printStackTrace (Ljava/lang/Throwable;)V"
and then app crashes on startup with the error mentioned above about missing ThrowableExtension Class
I ran the apk analyzer after the last step and was able to see the class in all 3 dexes that were created. here is a screen shot.
I checked $APP/build/intermediates/processing-tools/runtime-deps and I have and i have debug/desugar_try_with_resources.jar in there.
My steps to repo issue:
1) Clean build
2) Run app on Android 6 device (Moto G)
3) Unplug Android 6 device and connect Android 4.1.2 device (LG)
4) Install apk on android 4.1.2 device. I see this warning first:
"unable to resolve static method 54169: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;.printStackTrace (Ljava/lang/Throwable;)V"
and then app crashes on startup with the error mentioned above about missing ThrowableExtension Class
I ran the apk analyzer after the last step and was able to see the class in all 3 dexes that were created. here is a screen shot.
I checked $APP/build/intermediates/processing-tools/runtime-deps and I have and i have debug/desugar_try_with_resources.jar in there.
ga...@google.com <ga...@google.com> #11
Content of classes.dex indeed looks wrong, because if should contain ThrowableExtension classes. Also, classes2.dex and classes3.dex contain duplicate ThrowabelExtension$ classes which is wrong. Do you have a copy of ThrowableExtension.java in your source code?
I am unable to reproduce following steps in #10, and using the project in the attachment.
Is the issue still there if you update to the latest stable version, 3.1.1?
I am unable to reproduce following steps in #10, and using the project in the attachment.
Is the issue still there if you update to the latest stable version, 3.1.1?
[Deleted User] <[Deleted User]> #12
I do not have any mentions of ThrowableExtension in my project except in my proguard file where i put:
- keep class com.google.devtools.build.android.desugar.runtime.ThrowableExtension
I will update to 3.1.1 later today and see if the issue is still happening.
- keep class com.google.devtools.build.android.desugar.runtime.ThrowableExtension
I will update to 3.1.1 later today and see if the issue is still happening.
[Deleted User] <[Deleted User]> #13
Upgrading to Android Studio 3.1.1 fixed the issues for me. Errors no longer happen.
ga...@google.com <ga...@google.com> #14
Great, thanks for the update. In case you see the issue again, please update the bug. Thanks!
ya...@gmail.com <ya...@gmail.com> #15
I am facing the issue in gradle plugin 3.1.2
My App shows white screen and show the following error: -
Could not find class 'com.google.devtools.build.android.desugar.runtime.ThrowableExtension$ReuseDesugaringStrategy', referenced from method com.google.devtools.build.android.desugar.runtime.ThrowableExtension.<clinit>
I am testing on emulator with API 16.
My App shows white screen and show the following error: -
Could not find class 'com.google.devtools.build.android.desugar.runtime.ThrowableExtension$ReuseDesugaringStrategy', referenced from method com.google.devtools.build.android.desugar.runtime.ThrowableExtension.<clinit>
I am testing on emulator with API 16.
Description
all required information.
Studio Build:
Version of Gradle Plugin:3.0.1
Version of Gradle:4.4
Version of Java:1.8
OS:Mac
i am seeing this error on my app startup:
FATAL EXCEPTION: main java.lang.NoClassDefFoundError:com.google.devtools.build.android.desugar.runtime.ThrowableExtension
at com.example.phone.MyApplicationClass.onCreate(FpopApp.java:73)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1002)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4307)
at android.app.ActivityThread.access$1300(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1264)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4917)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
This issue has been happening for a while as mentioned here:
There was a thread where this issue was being handled but I was asked to create a new one. here is the old thread:
There are also duplicate threads:
Please try to resolve this issue. I am seeing it when I run my app on android 4.1.2 and android 6.0.