如何修复-在调试模式下签名的APK问题-Flutter应用

时间:2019-11-05 12:30:55

标签: flutter dart google-play

我什么都做。首先执行

  1. keytool -genkey -v -keystore〜/ key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

  2. 然后添加key.properties文件并在其中写入

storePassword=pasword
keyPassword= pasword
keyAlias=key
storeFile=/Users/macbook/Documents/key.jks
  1. 然后添加到build.gradle
    def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('key.properties')
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))


    signingConfigs {
            release {
                keyAlias keystoreProperties['keyAlias']
                keyPassword keystoreProperties['keyPassword']
                storeFile file(keystoreProperties['storeFile'])
                storePassword keystoreProperties['storePassword']
            }
        }
        buildTypes {
            release {
                signingConfig signingConfigs.release
            }
        }

并运行flutter build apk --release。而且当我将app-release.apk添加到Google Play时,仍然出现错误消息“您手机上上传的APK文件或应用程序包已在调试模式下签名。您必须在最终模式下登录。有关签名的更多信息。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

class A: def __init__(self,a): self.number = a class B(A): def __init__(self): super() i2 = B(3) i2.number # 3 is expected flutter clean解决了此问题。