狼愛上貍

          我胡漢三又回來了

          Flutter打包Apk

          https://www.jianshu.com/p/d58dab805ca6

          keytool -genkey -v -keystore ./key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
          apk 輸出在:
          C:\Users\Administrator\AndroidStudioProjects\flutter_app\build\app\outputs\apk\release
          key.properties
          storePassword=123456
          keyPassword=123456
          keyAlias=key
          storeFile=
          C:/Users/Administrator/AndroidStudioProjects/flutter_app/key.jks

          b
          uild.gradle

          def localProperties = new Properties()
          def localPropertiesFile = rootProject.file('local.properties')
          if (localPropertiesFile.exists()) {
          localPropertiesFile.withReader('UTF-8') { reader ->
          localProperties.load(reader)
          }
          }

          def flutterRoot = localProperties.getProperty('flutter.sdk')
          if (flutterRoot == null) {
          throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
          }

          def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
          if (flutterVersionCode == null) {
          flutterVersionCode = '1'
          }

          def flutterVersionName = localProperties.getProperty('flutter.versionName')
          if (flutterVersionName == null) {
          flutterVersionName = '1.0'
          }

          apply plugin: 'com.android.application'
          apply plugin: 'kotlin-android'
          apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


          def keystorePropertiesFile = rootProject.file("key.properties")
          def keystoreProperties = new Properties()
          keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
          android {
          compileSdkVersion 28

          sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
          }

          lintOptions {
          disable 'InvalidPackage'
          }

          defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId "com.example.flutter_app"
          minSdkVersion 16
          targetSdkVersion 28
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
          }

          signingConfigs {
          release {
          keyAlias keystoreProperties['keyAlias']
          keyPassword keystoreProperties['keyPassword']
          storeFile file(keystoreProperties['storeFile'])
          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.debug
          signingConfig signingConfigs.release
          }
          }
          }

          flutter {
          source '../..'
          }

          dependencies {
          implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
          testImplementation 'junit:junit:4.12'
          androidTestImplementation 'androidx.test:runner:1.1.1'
          androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
          }

          posted on 2020-02-29 11:48 狼愛上貍 閱讀(347) 評論(0)  編輯  收藏 所屬分類: flutter

          主站蜘蛛池模板: 卓资县| 赣州市| 拉萨市| 横山县| 周宁县| 邹城市| 沐川县| 金昌市| 大邑县| 临邑县| 广水市| 都匀市| 炉霍县| 龙里县| 江永县| 长宁县| 万源市| 武胜县| 洞口县| 北安市| 鸡泽县| 彝良县| 黄石市| 萝北县| 达日县| 临沂市| 城市| 儋州市| 连州市| 建湖县| 琼结县| 本溪市| 铅山县| 铜川市| 大化| 新乡县| 麟游县| 安多县| 潞西市| 白水县| 巴青县|