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

v1.12.13+hotfix.5 run flutter build apk have lost some class. #47462

Closed
zhuxiujia opened this issue Dec 19, 2019 · 10 comments
Closed

v1.12.13+hotfix.5 run flutter build apk have lost some class. #47462

zhuxiujia opened this issue Dec 19, 2019 · 10 comments
Labels
c: regression It was better in the past than it is now platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android

Comments

@zhuxiujia
Copy link

zhuxiujia commented Dec 19, 2019

in my project,flutter channel stable, v1.12.13+hotfix.5:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/alipay/sdk/app/EnvUtils$EnvEnum;
        at e.b.b.a$f.b()
        at g.v.i.a.a.a()
        at kotlinx.coroutines.p0.run()
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5422)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

in my project,flutter channel stable, v1.9.1+hotfix.6:

without any problems。

the flutter detail:

C:\Users\mayn>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.5)
[!] Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    X android-studio-dir = D:\Android\Android_Studio
    X Android Studio not found at D:\Android\Android_Studio
[√] IntelliJ IDEA Ultimate Edition (version 2019.3)
[√] Connected device (1 available)

! Doctor found issues in 2 categories.
@janmoppel
Copy link

Hello @zhuxiujia !

Thank you for posting an issue.
Can you please provide some more information, such as:

  1. flutter doctor -v command output;
  2. Minimal steps to reproduce the issue.

@janmoppel janmoppel added c: regression It was better in the past than it is now waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Dec 19, 2019
@dnfield
Copy link
Contributor

dnfield commented Dec 19, 2019

@blasten or @mklim does this look like a dexing/proguard issue to you?

@dnfield dnfield added t: gradle "flutter build" and "flutter run" on Android platform-android Android applications specifically labels Dec 19, 2019
@mklim
Copy link
Contributor

mklim commented Dec 19, 2019

Yes, it looks like a proguard issue to me. com/alipay/sdk/app/EnvUtils$EnvEnum was referenced somewhere in the app but at runtime it didn't actually exist anywhere in the apk so there was a crash. I'm not familiar with any changes we made around proguard directly in the latest stable but @blasten may know more.

As far as I know that's not a classpath we're using in Flutter itself anywhere. @zhuxiujia thank you for the bug report, would it be possible for you to also provide a minimal reproduction case that causes this error? Stackoverflow has a good guide on finding one.

If you're unable to figure out a working example, it would still be helpful here to have your pubspec.lock if possible. It's likely that this class is coming from a plugin indirectly and something about v1.12 is resulting in it being stripped out of the APK when it shouldn't be.

@zhuxiujia
Copy link
Author

Yes, it looks like a proguard issue to me. com/alipay/sdk/app/EnvUtils$EnvEnum was referenced somewhere in the app but at runtime it didn't actually exist anywhere in the apk so there was a crash. I'm not familiar with any changes we made around proguard directly in the latest stable but @blasten may know more.

As far as I know that's not a classpath we're using in Flutter itself anywhere. @zhuxiujia thank you for the bug report, would it be possible for you to also provide a minimal reproduction case that causes this error? Stackoverflow has a good guide on finding one.

If you're unable to figure out a working example, it would still be helpful here to have your pubspec.lock if possible. It's likely that this class is coming from a plugin indirectly and something about v1.12 is resulting in it being stripped out of the APK when it shouldn't be.

Hello :
github have a library named "https://github.com/OpenFlutter/tobias"
in this project "tobias/example/lib/main.dart"

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 20, 2019
@zhuxiujia
Copy link
Author

Hello @zhuxiujia !

Thank you for posting an issue.
Can you please provide some more information, such as:

  1. flutter doctor -v command output;
  2. Minimal steps to reproduce the issue.

hello,
How to close dexing/proguard ?

@thanhhai08sk
Copy link

You can disable proguard for example:
build apk --no-shrink

@zhuxiujia
Copy link
Author

You can disable proguard for example:
build apk --no-shrink

Thank you:
command flutter build apk --no-shrink it work successful,
and how to define in pubspec.yaml?
every time build apk need append --no-shrink ?

@zhuxiujia
Copy link
Author

zhuxiujia commented Dec 27, 2019

You can disable proguard for example:
build apk --no-shrink

Thank you:
in android/build.gradle

 buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release
            shrinkResources false
            zipAlignEnabled false
            minifyEnabled false
        }

run flutter build apk
it works successful. and run successful.

@rakib205
Copy link

@zhuxiujia you saved my ass. Thanks

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android
Projects
None yet
Development

No branches or pull requests

6 participants