binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
121 stars 70 forks source link

White screen in release APK in android 11 only #60

Closed vitulgoyani closed 2 years ago

vitulgoyani commented 3 years ago

when i run release apk it is show white screen and in debug mode is work well

binSaed commented 3 years ago

if release APK not working in all android version look to this secation https://github.com/AbdOoSaed/flutter_cached_pdfview#for-production-usage

vitulgoyani commented 3 years ago

Not solved, the same issue even I add this progaurd and make release build according to your link

binSaed commented 3 years ago

please try to run the example app and let me know download the whole project not only dart files only

https://github.com/AbdOoSaed/flutter_cached_pdfview/tree/master/example

RohithKilaparthi commented 3 years ago

same issue

binSaed commented 3 years ago

same comment

please try to run the example app and let me know download the whole project not only dart files only

https://github.com/AbdOoSaed/flutter_cached_pdfview/tree/master/example

vitulgoyani commented 3 years ago

yes your code is working but at release mode, I can't test and I use another plugin there is also the same issue so maybe it is PDF related issue it is work in older version but in android 11 it is show white screen

ghost commented 3 years ago

same issue

vitulgoyani commented 3 years ago

Does anyone have a solution or alternative?

binSaed commented 3 years ago

I test it with android 11 and it worked perfectly please download this app and try view pdf and let me know

https://play.google.com/store/apps/details?id=com.Suhaib_Digital_Base

https://user-images.githubusercontent.com/33700292/125340588-ebee0480-e352-11eb-9559-dea47b13c69e.mp4

vitulgoyani commented 3 years ago

your app is working fine

nhat108 commented 3 years ago

@vitulgoyani try this solution, it's working: https://github.com/arnaudelub/flutter_fullpdfview/issues/21#issuecomment-826481409

vitulgoyani commented 3 years ago

your link is not working @AbdOoSaed

nhat108 commented 3 years ago

@vitulgoyani did you add this line yet? i was faced your problem and solved image

saelco commented 3 years ago

Flutter Wrapper

-keep class io.flutter.app. { *; } -keep class io.flutter.plugin.* { ; } -keep class io.flutter.util. { *; } -keep class io.flutter.view. { *; } -keep class io.flutter.* { ; } -keep class io.flutter.plugins. { *; } -keep class com.shockwave.* { ; }

and in 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.debug minifyEnabled true useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }

mb-auh commented 3 years ago

I've got the same problem in both debug and release build. I wasn't using ProGuard in the first place but @saelco sadly your suggestions did not help fix the problem even after enabling it. @AbdOoSaed I looked at the sample code of your app and I cannot find any significant differences regarding this behavior. @saelco @AbdOoSaed Which version of flutter are you using?

EugenEistrach commented 2 years ago

I have same issue, also not using proguard at all. Release apk does not work (white screen) but debug apk no issues.

wladrbarbosa commented 2 years ago

I have same issue, but in my case neither debug nor release doesn't work.

vitulgoyani commented 2 years ago

This is work for me

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

and this is my proguard file, put this file in android/app/

proguard-rules.pro.zip

binSaed commented 2 years ago

Thanks @vitulgoyani

it is the same as Example project https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/804ee6adbabecb6602391339c5c46f4abdcb3a58/example/android/app/build.gradle#L48

https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/804ee6adbabecb6602391339c5c46f4abdcb3a58/example/android/app/proguard-rules.pro#L1

vitulgoyani commented 2 years ago

Thanks @vitulgoyani

it is the same as Example project

https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/804ee6adbabecb6602391339c5c46f4abdcb3a58/example/android/app/build.gradle#L48

https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/804ee6adbabecb6602391339c5c46f4abdcb3a58/example/android/app/proguard-rules.pro#L1

this is different -keep class com.shockwave.* { ; }

lngvnsang commented 1 year ago

-keep class com.shockwave.* { ; }

Thanks, This is work for me!

remove 'useProguard true' if got error