无法在本机上构建APK

时间:2019-07-03 12:46:18

标签: android react-native

我试图用本机签名apk但我遇到了一些问题

任务':app:packageRelease'的执行失败。

  

无法从商店“ D:\ project \ profile-muhammadiyah \ android \ app \ my-upload-key.keystore”中读取密钥my-upload:在密钥库D:\中找不到别名为“ my-upload”的密钥project \ profile-muhammadiyah \ android \ app \ my-upload-key.keystore

MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-upload
MYAPP_UPLOAD_STORE_PASSWORD=amicumss_
MYAPP_UPLOAD_KEY_PASSWORD=amicumss_
release {
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }

1 个答案:

答案 0 :(得分:0)

错误表明问题出在哪里!
您的密钥库中没有别名为“ my-upload”的密钥

您应该在密钥存储区中创建它,并在code in command prompt for windows下运行:

keytool -genkeypair -v -keystore my-upload-key.keystore -alias my-upload -keyalg RSA -keysize 2048 -validity 10000