今天从同事那里拷贝了一个 React Native 项目,打包的时候出错了,错误信息如下
Build file '/Users/yufei/Downloads/xxx/android/app/build.gradle' line: 202 * What went wrong: A problem occurred evaluating project ':app'. > Could not get unknown property 'MYAPP_RELEASE_STORE_FILE' for SigningConfig_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=jks, v1SigningEnabled=true, v2SigningEnabled=true} of type com.android.build.gradle.internal.dsl.SigningConfig.
原因是打包的签名文件配置没找到,修复方法就是使用 keytool
重新生成一个(或者你已经生成了)然后修改
android/gradle.properties
文件添加以下属性
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore MYAPP_RELEASE_KEY_ALIAS=my-key-alias MYAPP_RELEASE_STORE_PASSWORD=123456 MYAPP_RELEASE_KEY_PASSWORD=123456
具体的属性值要按照你的来
目前尚无回复