gstory0404 / file_preview

A plug-in that supports flutter preview files,Flutter文档预览
Apache License 2.0
49 stars 36 forks source link

Issue building on Codemagic #32

Open emmett-deen opened 1 year ago

emmett-deen commented 1 year ago

We would really like to use this package, but we may have to remove due to build issues. It's very odd since it still builds the .aab file, but then in our CICD platform it tries to sign what I assume are dependency APK's after which fails. It specifically fails on 1 saying no min SDK version is specified. Here are our logs:

> flutter build appbundle --release
The plugin `flutter_geocoder` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

Running Gradle task 'bundleRelease'...                          
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 2232 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "fa-solid-900.ttf" was tree-shaken, reducing it from 397420 to 8988 bytes (97.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "fa-regular-400.ttf" was tree-shaken, reducing it from 62320 to 2840 bytes (95.4% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Note: /Users/builder/.pub-cache/hosted/pub.dev/geolocator_android-4.1.7/android/src/main/java/com/baseflow/geolocator/location/FusedLocationClient.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:158: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_HIGH);
                                 ^
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:162: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_2160P);
                                 ^
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:166: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_1080P);
                                 ^
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:170: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_720P);
                                 ^
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:174: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_480P);
                                 ^
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:178: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_QVGA);
                                 ^
/Users/builder/.pub-cache/hosted/pub.dev/camera_android-0.10.4/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java:182: warning: [deprecation] get(int,int) in CamcorderProfile has been deprecated
          return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_LOW);
                                 ^
7 warnings
Note: /Users/builder/.pub-cache/hosted/pub.dev/flutter_geocoder-0.2.2-nullsafety/android/src/main/java/com/aloisdeniel/geocoder/GeocoderPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/builder/.pub-cache/hosted/pub.dev/google_mlkit_commons-0.2.0/android/src/main/java/com/google_mlkit_commons/InputImageConverter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Running Gradle task 'bundleRelease'...                            212.7s
✓ Built build/app/outputs/bundle/release/app-release.aab (63.5MB).

Signing docxRes.apk
Signing pptxRes.apk
Signing excelRes.apk
Signing file_cp_resources.apk
Signing file_resource.apk
Signing BaseComponent_resource.apk
Failed to sign artifact file_cp_resources.apk. Failed to sign apk: Exception in thread "main" com.android.apksig.apk.MinSdkVersionException: Failed to determine APK's minimum supported platform version. Use --min-sdk-version to override
    at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:401)
    at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:92)
Caused by: com.android.apksig.apk.MinSdkVersionException: Failed to determine APK's minimum supported Android platform version
    at com.android.apksig.ApkSigner.getMinSdkVersionFromApk(ApkSigner.java:968)
    at com.android.apksig.ApkSigner.sign(ApkSigner.java:287)
    at com.android.apksig.ApkSigner.sign(ApkSigner.java:223)
    at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:395)
    ... 1 more
Caused by: com.android.apksig.apk.ApkFormatException: Missing AndroidManifest.xml
    at com.android.apksig.ApkSigner.getAndroidManifestFromApk(ApkSigner.java:924)
    at com.android.apksig.ApkSigner.getMinSdkVersionFromApk(ApkSigner.java:966)
    ... 4 more

Build failed :|
Failed to sign artifacts
gstory0404 commented 1 year ago

This problem seems to be caused by flutter_geocoder. The latest update of this plugin was 2 years ago. Try to remove this plugin.

emmett-deen commented 1 year ago

That was not the issue. Removing this package and keeping flutter_geocoder builds successfully.