2014-12-05 23 views
0

我试图在Android Studio中以发布模式签署我的Android应用。在Android Studio中以发布模式构建Android应用时出错

我跟着this official guide。所以我创建了密钥库和私钥。然后我试着从Build - > Generate Signed API Key生成已签名的APK。但构建失败,出现以下错误:

: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 
     } 
    } 

有什么不对?

+0

文件'android.jks'存在于C:\ Documents \ myapp \? – 2014-12-05 19:21:20

+0

当然是@PetrDuchek – GVillani82 2014-12-05 19:22:27

回答

0

我已经解决了这个问题,简单地移动我的Android项目的基本路径内的密钥库。

0

通过\\更换\

storeFile file('C:\\Documents\\myapp\\android.jks') 
相关问题