flutter_pdf_viewer icon indicating copy to clipboard operation
flutter_pdf_viewer copied to clipboard

AbiFilters and AppBundle

Open d-apps opened this issue 5 years ago • 6 comments

Is there any workaround I could do to be able to build appbundle with pdf compatible with both archs instead of building 2 APKs with different abifilters, since appbundle optimize the app and reduce the app size?

d-apps avatar Jan 28 '20 17:01 d-apps

@devxpy hey brother , we would really appreciate it if you updated this package with the fix for release version , everything else about this package is just perfect , it is the best pdf package for flutter , I may have noticed something that could be the source of the problem , here , in class PdfViewer {static const channel = MethodChannel('com.pycampers.flutter_pdf_viewer');} , but when you check the android (kotlin) package you find com.pycampers.flutterpdfviewer , also you changed the name of pycampers to scientifichackers , idk if this is causing the problem or part of it , but I hope you can fix it

phaylali avatar Feb 01 '20 13:02 phaylali

I did an adb log for my app which in that case was installed by release apk ,and it gave me this error E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method launchPdfActivity on channel com.pycampers.flutter_pdf_viewer) it doesn't give that error on debug mode

phaylali avatar Feb 01 '20 15:02 phaylali

I did an adb log for my app which in that case was installed by release apk ,and it gave me this error E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method launchPdfActivity on channel com.pycampers.flutter_pdf_viewer) it doesn't give that error on debug mode

I am having the same error, it fails to call the native method only in x64 apk version, any thoughts?

I was wondering if we could force install x86 apk instead x64 on Play Store, but I don't think it's possible. :/

d-apps avatar Feb 03 '20 21:02 d-apps

This looks like its caused by https://github.com/scientifichackers/flutter_pdf_viewer/issues/30.

Try adding the following to android/app/build.gradle

android {
    ...

    buildTypes {
        release {
			...
         
            shrinkResources false
            minifyEnabled false
        }
    }
}

If you really want to have code obfuscation and have the patience to do it, then you may try writing specific proguard rules to avoid the plugin and its dependencies from being obfuscated.

devxpy avatar Apr 21 '20 21:04 devxpy

@devxpy can you update the package with newest gradle version and kotlin version ? it didn't get updated from august

phaylali avatar Apr 23 '20 00:04 phaylali

Those that want to keep minify enabled along with shrink resources can use:

 -keep class com.shockwave.** { *; }
 -keep class com.pycampers.** { *; }

in their proguard-rules.pro

The shockwave class is used by the base library. The pycampers class is used by this plugin.

razein97 avatar Aug 31 '20 05:08 razein97