技术CTO-关注编程入门知识,提供编程入门教程

您的位置: 首页 > 移动开发 > android > 正文

Studio 签名打包出现 java.io.IOException: Can't write、Can't read 异常

来源: 技术CTO 阅读:

 日志如下:在线求解
  Copying resources from program jar [D:\Android\studioSdk\extras\android\m2repository\com\android\support\support-annotations\22.2.1\support-annotations-22.2.1.jar] (filtered)
Warning:Exception while processing task java.io.IOException: Can't write [D:\Android\StudioWorkSpaces\NewsEnjoy\app\build\intermediates\transforms\proguard\release\jars\3\1f\main.jar] (Can't read [D:\Android\studioSdk\extras\android\m2repository\com\android\support\support-annotations\22.2.1\support-annotations-22.2.1.jar(;;;;;;**/*.class)] (Duplicate zip entry [android/support/annotation/c.class == support-annotations-22.2.1.jar:android/support/annotation/AnyRes.class]))
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Can't write [D:\Android\StudioWorkSpaces\NewsEnjoy\app\build\intermediates\transforms\proguard\release\jars\3\1f\main.jar] (Can't read [D:\Android\studioSdk\extras\android\m2repository\com\android\support\support-annotations\22.2.1\support-annotations-22.2.1.jar(;;;;;;**/*.class)] (Duplicate zip entry [android/support/annotation/c.class == support-annotations-22.2.1.jar:android/support/annotation/AnyRes.class]))

不知楼主解决了没, 碰到一样的错..
Execution failed for task ':mscSecure:transformClassesAndResourcesWithProguardForChinaProductionRelease'.
> java.io.IOException: Can't write [C:\Users\Administrator\Desktop\msc_android_05_25 -deepcam\msc-android\mscSecure\build\intermediates\transforms\proguard\chinaProduction\release\jars\3\1f\main.jar] 
(Can't read [E:\BaiduYunDownload\sdk\extras\android\m2repository\com\android\support\support-annotations\23.0.1\support-annotations-23.0.1.jar(;;;;;;**/*.class)]
 (Duplicate zip entry [support-annotations-23.0.1.jar:android/support/annotation/LayoutRes.class]))
引用 1 楼 qq_26674955 的回复:
不知楼主解决了没, 碰到一样的错..
Execution failed for task ':mscSecure:transformClassesAndResourcesWithProguardForChinaProductionRelease'.
> java.io.IOException: Can't write [C:\Users\Administrator\Desktop\msc_android_05_25 -deepcam\msc-android\mscSecure\build\intermediates\transforms\proguard\chinaProduction\release\jars\3\1f\main.jar] 
(Can't read [E:\BaiduYunDownload\sdk\extras\android\m2repository\com\android\support\support-annotations\23.0.1\support-annotations-23.0.1.jar(;;;;;;**/*.class)]
 (Duplicate zip entry [support-annotations-23.0.1.jar:android/support/annotation/LayoutRes.class]))
求解,我也是这个问题,主要还是加了友盟后
是不是没有声明需要读写权限啊?
mainfest文件里没有声明
在Android的manifest.xml文档中加入下面的声名:
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
参考这个
http://blog.csdn.net/chengyingzhilian/article/details/7279494

^_^ 如果您热爱技术、热爱编程,想与更多的朋友一起交流学习,欢迎加入本站官方QQ群:345733473 ^_^