Android 中Failed to read key from keystore解决办法

Caused by: org.gradle.tooling.BuildException: Failed to read key from keystore     at com.android.build.gradle.tasks.PackageApplication.doFullTaskAction(PackageApplication.groovy:110)     at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.groovy:64)     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactor y.java:235)     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.jav a:211)     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory. java:222)     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.jav a:200)     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)     ... 47 more Caused by: com.android.builder.packaging.SigningException: Failed to read key from keystore     at com.android.builder.core.AndroidBuilder.packageApk(AndroidBuilder.java:1468)     at com.android.builder.core.AndroidBuilder$packageApk$6.call(Unknown Source)     at com.android.build.gradle.tasks.PackageApplication.doFullTaskAction(PackageApplication.groovy:95)     ... 55 more 

build.gradle

signingConfigs {   robert {     storePassword 'robert'     storeFile file('/Users/bournewang/Documents/Project/android.keystore')     keyPassword 'robert'     keyAlias 'mike'   } } 


解决方案:

Check your keystore file for first, in you example you creating file with name my-release-key.keystore. If its correct and really present in folder Users/bournewang/Documents/Project check alias, in your example it is -alias alias_name, but in config you specified alias mike

大意是:

1.android.keystore可能不在指定目录下面

2.keyAlias不对

另:想知道真正原因的话,可以查看

To find out what's wrong you can use gradle's singingReport command.  On mac:  ./gradlew signingReport On Windows:  gradle signingReport 

如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

更多相关文章

  1. 禁止横竖屏自动切换
  2. android 混淆文件proguard.cfg详解
  3. 关于资源文件:颜色
  4. Android(安卓)五大布局
  5. Android(安卓)通过程序添加桌面快捷方式
  6. Android自动连接指定的WiFi热点
  7. Intent详解(二)----Intent过滤器
  8. 【入门篇】Android学习笔记――常用布局
  9. 可显示Android设备选择列表,并进入指定Android设备Console的Shell

随机推荐

  1. android——代码实现在指定位置显示View
  2. Android开发周报:Android(安卓)Studio2.0
  3. java获取页面输入的值
  4. EditText 的setKeyListener()方法的用法
  5. Android(安卓)JNI 学习笔记
  6. 电脑导出文件到手机 adb push
  7. Android(安卓)使用NDK R5开发JNI应用详解
  8. Android(安卓)Studio基础:USB联调App
  9. SAX解析 android sdk与jdk 有点区别
  10. Handler部分原理