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

Not working on release mode - playstore #7

Closed
shubhamsinha2009 opened this issue May 20, 2022 · 9 comments
Closed

Not working on release mode - playstore #7

shubhamsinha2009 opened this issue May 20, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@shubhamsinha2009
Copy link
Contributor

No description provided.

@andreBalh
Copy link
Collaborator

Hi @shubhamsinha2009
Thank you for opening this issue.
Could you provide more information about your problem?

You can paste the text of flutter doctor -v here.

And do you know which device had this problem and which Android version was used?

@andreBalh andreBalh added bug Something isn't working question Further information is requested Waiting for response Wating for response of author who opened that issue labels May 23, 2022
@shubhamsinha2009
Copy link
Contributor Author

Hi @shubhamsinha2009 Thank you for opening this issue. Could you provide more information about your problem?

You can paste the text of flutter doctor -v here.

And do you know which device had this problem and which Android version was used?

Android 11 and 12

@carman247
Copy link

carman247 commented Jun 30, 2022

Also facing this issue. Project builds but AlhPdfView is not visible on the screen.

Really hoping you can fix this as this is possible the best pdf package out there at the moment.

Potential issue

I've found this in the onError:

java.lang.UnsatisfiedLinkError: No implementation found for long d.e.a.c.o(int, java.lang.String) (tried Java_d_e_a_c_o and Java_d_e_a_c_o__ILjava_lang_String_2)

Package

alh_pdf_view: ^0.3.0

Flutter doctor -v

[✓] Flutter (Channel stable, 3.0.3, on macOS 11.6 20G165 darwin-x64, locale en-GB)
    • Flutter version 3.0.3 at /Users/chris/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (8 days ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/chris/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_SDK_ROOT = /Users/chris/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.68.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (3 available)
    • Mi 9T Pro (mobile) • 94b9d1dc • android-arm64  • Android 11 (API 30)
    • macOS (desktop)    • macos    • darwin-x64     • macOS 11.6 20G165 darwin-x64
    • Chrome (web)       • chrome   • web-javascript • Google Chrome 103.0.5060.53

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@carman247
Copy link

I have found a fix

Create a file called proguard-rules.pro in android/app/ directory.

Add this to the file

-keepclasseswithmembernames,includedescriptorclasses class * {
    native <methods>;
}

in the app level build.gradle (android/app/build.gradle) add this to your release build type

            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

e.g.

    buildTypes {
        release {
            signingConfig signingConfigs.debug
            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

@andreBalh
Copy link
Collaborator

andreBalh commented Jul 1, 2022

Hello @carman247
Thank you for the extra information.
I will try to reproduce this problem and will release a fix asap.

@andreBalh andreBalh removed question Further information is requested Waiting for response Wating for response of author who opened that issue labels Jul 1, 2022
@carman247
Copy link

@andreBalh

No problem, unfortunately I'm not sure how to implement this fix in the package, only projects depending on it

@andreBalh
Copy link
Collaborator

Yep your suggested solution would work and I could implement this for the example project but it would be better if you don't have to add proguard just to fix it @carman247

@andreBalh
Copy link
Collaborator

I found a solution to fix this problem, I will make a PR and release the fix @carman247 @shubhamsinha2009

@andreBalh
Copy link
Collaborator

I am closing this issue, fix will be released in v.0.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants