在Android Studio中以发布模式构建Android应用程序时出错
我正试图在android Studio中以发布模式登录我的android应用程序 我跟着。因此,我创建了密钥库和私钥。然后我尝试从Build->Generate Signed API Key生成签名的APK。但是构建失败,出现以下错误:在Android Studio中以发布模式构建Android应用程序时出错,android,gradle,build.gradle,android-keystore,Android,Gradle,Build.gradle,Android Keystore,我正试图在android Studio中以发布模式登录我的android应用程序 我跟着。因此,我创建了密钥库和私钥。然后我尝试从Build->Generate Signed API Key生成签名的APK。但是构建失败,出现以下错误: :app:packageRelease FAILED Error:A problem was found with the configuration of task ':app:packageRelease'. > File 'C:\Documents\
:app:packageRelease FAILED
Error:A problem was found with the configuration of task ':app:packageRelease'.
> File 'C:\Documents\myapp\android.jks' specified for property 'signingConfig.storeFile' does not exist.
我还检查了build.gradle配置。我发现:
signingConfigs {
releaseConfig {
keyAlias 'xxxxxxxxxx'
keyPassword 'xxxxxxxxx'
storeFile file('C:\Documents\myapp\android.jks')
storePassword 'xxxxxxxxx'
}
}
但在同一个gradle文件中,我有:
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseConfig
}
}
怎么了?用
\
替换\
:
storeFile file('C:\\Documents\\myapp\\android.jks')
我已经解决了这个问题,只需将密钥库移动到我的android项目的基本路径中。将
keystore
文件放在该项目的app
文件夹中,并替换为以下内容
storeFile file('android.jks')
文件
android.jks
存在于C:\Documents\myapp\?当然,@PetrDuchek