Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the generated standalone apk can't support 4.x device if Apk contains java8 lambda expressions #112

Closed
staney7 opened this issue Aug 16, 2019 · 4 comments

Comments

@staney7
Copy link

staney7 commented Aug 16, 2019

I use bundletool to generate a standalone APK for 4.x device , but it can't work. I find that when I use lambda expression in my application code , the appliaction will crash because of NoClassDefFoundError.

@staney7
Copy link
Author

staney7 commented Aug 16, 2019

My APK has a dynamic module .There is three dex file in main module and one dex in a dynamic module. And in this dynamic module , I set fusing = true .

@plecesne
Copy link
Contributor

plecesne commented Aug 19, 2019

This might have been fixed with a more recent version of D8. We have plans to upgrade the version soon, but you could try to update the dependency locally in your build gradle file by setting compile "com.android.tools:r8:1.4.93"

@staney7
Copy link
Author

staney7 commented Aug 20, 2019

I try to set comile "com.android.tools:r8:1.4.93" in my app build gradle file, but it doesn't work for me, the application will crash too. My Android studio version is 3.4.2 , gradle version is 5.1.1 and android tool version is 3.4.2. Is there any other way to fix it?

This is my Stacktrace:
java.lang.NoClassDefFoundError: xxx.xxx.xxx.application.-$$Lambda$xxx$QGeZTlQAk2uB9tqYz1X2P6IgRoA
at xxx.xxx.xxx.application.xxx.attachBaseContext(xxx.java:96)
at android.app.Application.attach(Application.java:194)
at android.app.Instrumentation.newApplication(Instrumentation.java:991)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:515)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4433)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:212)
at android.app.ActivityThread.main(ActivityThread.java:5133)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
at dalvik.system.NativeStart.main(Native Method)

@ymakhno
Copy link
Collaborator

ymakhno commented Jun 29, 2021

Core desugaring library support is implemented in bundletool 1.7.0.

@ymakhno ymakhno closed this as completed Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants