本文件詳細說明 Flutter 專案在 iOS 與 Android 平台進行 Release(正式版)Build 的完整流程、注意事項與常用指令,適合準備上架 App Store / Google Play 前參考。
一、建置前通用檢查(iOS / Android)
1. Flutter 環境確認
flutter doctor
本文件詳細說明 Flutter 專案在 iOS 與 Android 平台進行 Release(正式版)Build 的完整流程、注意事項與常用指令,適合準備上架 App Store / Google Play 前參考。
flutter doctor
本教學將帶你 用最標準、最安全、最省時的方式,在 Flutter 專案中同時產生 iOS 與 Android 的 App Icon。
✅ 適用:正式上架 App Store / Google Play
✅ 不需手動切圖、不碰 Xcode / Android Studio
👉 使用官方主流套件:flutter_launcher_icons
本指南將分步帶您完成在 Flutter 應用程式中設置 Firebase Cloud Messaging (FCM) 的過程,涵蓋 Android 和 Dart (Flutter) 兩個部分。
google-services.json 文件。以下是根據 Flutter 官方文件中「」的說明,整理出的一個典型國際化(locale)實作流程,並以 Markdown 格式呈現,便於閱讀與使用:
在 pubspec.yaml 中加入以下依賴:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.18.0
new interface class:
// sample class
class S {
void Function(String)? onABC;
void Function(int)? onDEF;
STTCallback({this.onABC, this.onDEF});
}
testparm
Dart does not currently have an arbitrary base logarithm function, only base e (log). This is most likely inherited from JavaScript, which also only provides these two.
In general, the logarithm at one base, b1, can be found using the logarithm at any other base, b2 as logb1(x) = logb2(x) / logb2(b1).
# Flutter build failed on andorid platform
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':path_provider_android:androidJdkImage'.
> Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JdkImageTransform: D:\Android_SDK\Sdk\platforms\android-35\core-for-system-modules.jar.
> Error while executing process C:\Program Files\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path C:\Users\XXXXXXXXX\.gradle\caches\transforms-3\cc12c5242eac95612f50f56c
5a36d784\transformed\output\temp\jmod --add-modules java.base --output C:\Users\XXXXXXXXX\.gradle\caches\transforms-3\cc12c5242eac95612f50f56c5a36d784\transformed\output\jdkImage --disable-plugin syst
em-modules}
* 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 6s
Running Gradle task 'assembleDebug'... 7.6s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] This is likely due to a known bug in Android Gradle Plugin (AGP) versions less than 8.2.1, when │
│ D:\XXXXXXXXXXXXXXXXX\android\settings.gradle, │
│ in the 'plugins' closure (by the number following "com.android.application"). │
│ Alternatively, if your project was created with an older version of the templates, it is likely │
│ in the buildscript.dependencies closure of the top-level build.gradle: │
│ D:\XXXXXXXXXXXXXXXXX\android\build.gradle, │
│ as the number following "com.android.tools.build:gradle:". │
│ │
│ For more information, see: │
│ https://issuetracker.google.com/issues/294137077 │
│ https://github.com/flutter/flutter/issues/156304 │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Git Submodule 允許你在一個 Git 倉庫內嵌套另一個 Git 倉庫,適用於依賴管理或共享代碼的場景。
git submodule add <repository_url> <path>
pip list --format=freeze > requirements.txt