flutter打包

如果没有keystore可以通过在命令行输入:
keytool -genkey -alias release.keystore -keyalg RSA -validity 36500 -keystore release.keystore
release.keystore 代表名字
36500代表天数

  signingConfigs {
        release {
            keyAlias 'enjoy'
            keyPassword '123456'
            // 因为是放到父级的根目录,使用rootProject
            // 如果放在这个build.gradle的同级,直接使用file
            storeFile rootProject.file('release.keystore')
            storePassword '123456'
        }
    }
 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
        }
    }

通过命令行输入flutter build apk 进行打包

你可能感兴趣的:(flutter打包)