注:C:/20190628/android 爲key保存路徑android
storePassword=<password from previous step> //輸入上一步建立KEY時輸入的 密鑰庫 密碼 keyPassword=<password from previous step> //輸入上一步建立KEY時輸入的 密鑰 密碼 keyAlias=key storeFile=C:/20190628/android/file //key.jks的存放路徑
def keystorePropertiesFile = rootProject.file("key.properties") def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
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.debug } }
替換成app
signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] } } buildTypes { release { signingConfig signingConfigs.release } }
flutter build apk
注:大坑!gradle
請將key.properties文件中值後全部字符刪除,不然會報錯ui