flutter_full_pdf_viewer icon indicating copy to clipboard operation
flutter_full_pdf_viewer copied to clipboard

Android APK bundle weight

Open enricobenedos opened this issue 4 years ago • 5 comments

Good morning, I noticed a big bundle weight increase after adding this package to my pubspec.yaml packages file. Before

enricobenedos@MBP-di-Enrico my_app % flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Note: /Users/enricobenedos/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: Some input files use unchecked or unsafe operations.              
Note: Recompile with -Xlint:unchecked for details.                      
Note: Some input files use or override a deprecated API.                
Note: Recompile with -Xlint:deprecation for details.                    
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      70.8s
✓ Built build/app/outputs/apk/release/app-release.apk (23.3MB).

Now

enricobenedos@MBP-di-Enrico my_app % flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      67.7s
✓ Built build/app/outputs/apk/release/app-release.apk (40.3MB).

From 23.3MB to 40.3 MB. Is it normal? I've never seen a Flutter heavy package like this. Does this package use native iOS and Android API?

Thank you

enricobenedos avatar Mar 22 '20 14:03 enricobenedos

I have the same problem,forwarding............

liyang1518 avatar May 11 '20 01:05 liyang1518

Most of the packages relating to pdf in flutter add from 15-17mb to the build size. The solution I found was to use the native pdf view package. It processes pdf natively without adding to build size.

razein97 avatar Jul 29 '20 18:07 razein97

@razein97 How to use, can there be examples?

liyang1518 avatar Aug 05 '20 09:08 liyang1518

@liyang1518 https://pub.dev/packages/native_pdf_view Check the pub page. It's explained pretty clearly.

razein97 avatar Aug 05 '20 09:08 razein97

@liyang1518 https://pub.dev/packages/native_pdf_view Check the pub page. It's explained pretty clearly.

ok,thinks

liyang1518 avatar Aug 05 '20 09:08 liyang1518