:::
8. 打包
加上首頁啟動 icon
- 準備一張 1024X1024 的圖檔
- 到app icon網站自動產生需要的icon檔 https://appicon.co/
- 把檔案放到以下的資料夾
<app dir>/android/app/src/main/res/
App 金鑰
- Mac
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key - Windows
keytool -genkey -v -keystore ./key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key - 在 android 資料夾中制作一個
<app dir>\android\key.properties檔案storePassword=密碼 keyPassword=密碼 keyAlias=key storeFile=../../key.jks - 編輯
<app dir>\android\app\build.gradle檔略 def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } android { 略 defaultConfig { 略 } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } } 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.release } } } - 到
<app dir>/android/app/src/main/AndroidManifest.xml修改app 顯示名稱
編譯 APK 檔
flutter build apk --split-per-abi --target-platform android-arm,android-arm64,android-x64
7. 常用套件