前提・実現したいこと
flutter でリリースビルドのapkを作成したいです。
発生している問題・エラーメッセージ
flutter build apk --release
を実行すると以下のエラーが発生します。
AQ-S380-MacBookPro:starX teppei.kikuchi$ flutter build apk --release 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 Plugin project :connectivity_macos not found. Please update settings.gradle. Note: /Users/teppei.kikuchi/project/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.9/android/src/main/java/io/flutter/plugins/connectivity/ConnectivityBroadcastReceiver.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/teppei.kikuchi/project/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-1.2.0+1/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /Users/teppei.kikuchi/project/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Removed unused resources: Binary resource data reduced from 304KB to 277KB: Removed 8% FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':firebase_analytics:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed /Users/teppei.kikuchi/.gradle/caches/transforms-2/files-2.1/3aaf6e5219b7f981ec263df919098c6f/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found. /Users/teppei.kikuchi/.gradle/caches/transforms-2/files-2.1/3aaf6e5219b7f981ec263df919098c6f/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1m 17s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 78.5s The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility. Building plugin connectivity... Running Gradle task 'assembleAarRelease'... Running Gradle task 'assembleAarRelease'... Done 1.4s FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'connectivity'. > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s The plugin connectivity could not be built due to the issue above.
該当のソースコード
/Users/teppei.kikuchi/project/flutter/bin/flutter doctor --verbose [✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-US) • Flutter version 1.17.5 at /Users/teppei.kikuchi/project/flutter • Framework revision 8af6b2f038 (4 weeks ago), 2020-06-30 12:53:55 -0700 • Engine revision ee76268252 • Dart version 2.8.4 [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/teppei.kikuchi/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Applications/Xcode_11.5.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.9.1 [✓] Android Studio (version 3.6) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211) [✓] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator) • No issues found! Process finished with exit code 0
dart:pubspec.yaml
name: starx description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: sdk: ">=2.7.0 <3.0.0" dependencies: flutter: sdk: flutter carousel_slider: ^2.2.1 flutter_svg: ^0.17.4 auto_size_text: ^2.1.0 pin_entry_text_field: ^0.1.3 intl: ^0.16.1 indonesia: ^1.0.1 keyboard_visibility: ^0.5.6 http: ^0.12.1 shared_preferences: ^0.5.7+3 flutter_launcher_icons: ^0.7.5 connectivity: ^0.4.9 dio: ^3.0.9 firebase_core: ^0.2.5 # add dependency for Firebase Core firebase_analytics: ^1.0.4 image_picker: ^0.6.0+9 photo_view: ^0.9.2 json_annotation: provider: ^4.1.3 mime_type: ^0.3.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.3 dev_dependencies: flutter_test: sdk: flutter build_runner: ^1.7.3 json_serializable: freezed: flutter_icons: android: "launcher_icon" ios: true image_path: "assets/images/logo_starx.png" image_path_ios: "assets/images/logo_starx.png" # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: assets: - assets/images/ - assets/svg/ - assets/svg/iconDashboard/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: fonts: - family: Quicksand fonts: - asset: fonts/Quicksand-Regular.ttf # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages
補足情報(FW/ツールのバージョンなど)
Pluginのバージョン等が影響しているような記事を見かけました。が、解決できず、、
まだ回答がついていません
会員登録して回答してみよう