Flutter packaging and release FAQs

1. Android

  1.  After packaging, the splash screen closes when the apk is opened.
    1. android {
              buildTypes {
                  release {
                      // Enables code shrinking, obfuscation, and optimization for only
                      // your project's release build type.
                      minifyEnabled false
      
                      // Enables resource shrinking, which is performed by the
                      // Android Gradle plugin.
                      shrinkResources false
                  }
              }
              ...
          }
      
  2. Configure signature file

         key.properties is placed under the android directory of the project. demo.jks is placed under the android/app/key directory of the project, and the key directory is created manually.

storePassword=android1223
keyPassword=1234
keyAlias=demo
storeFile=key/demo.jks

         Add the following configuration to build.gradle in the app directory under the android project            

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

 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.release
            //关闭混淆
            minifyEnabled false //删除无用代码
            shrinkResources false //删除无用资源
        }
    }

2. IOS aspect

  1. An error occurred when uploading because of the app's icon.

          Reason: 1024*1024 icon cannot have transparency. Other icons can be made into rounded corners

     2. When filling in the phone number in the contact information in app store connect, the format of the 11-digit mobile phone number entered is wrong.

          Reason: There is indeed a problem with the format. The normal format is: +86-xxxxxxxxxxx For example: +86-010-33339999

     3. The version number uses the unified configuration file.

         Method: You need to use flutter build ios --build-name=1.0.2 in the ios directory of the project to package or use xcode to package. The version number is in the configuration file.

Supongo que te gusta

Origin blog.csdn.net/saperliu/article/details/131584831
Recomendado
Clasificación