狼愛上貍

          我胡漢三又回來了

          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

          主站蜘蛛池模板: 岱山县| 清水县| 锡林郭勒盟| 岱山县| 遂宁市| 咸宁市| 库伦旗| 玉龙| 宁陵县| 定西市| 南京市| 湖南省| 云南省| 遵义县| 南宫市| 西盟| 拉萨市| 扎囊县| 江陵县| 金堂县| 余姚市| 凌源市| 闻喜县| 江华| 武定县| 老河口市| 陇西县| 远安县| 金湖县| 绵竹市| 河北省| 龙口市| 永年县| 北票市| 宜阳县| 连平县| 囊谦县| 清河县| 靖宇县| 周口市| 射洪县|