问题六:
Android Studio 2.3打包后,安装到手机失败。
标红的地方已经提到,选择 V2 签名,则无效,我这里也得到了相应的提示了。也就是说,V2 签名之后,当前 apk 是不能做任何操作了。
后面我也做了一下尝试,除了 单独勾选 V2 签名无效之外,其他的单选 V1 , 或者 V1 , V2同时勾选,签名之后的包都能正常发放了。
http://blog.csdn.net/builder_taoge/article/details/70158690
Android studio2.3之前是可以直接安装到设备上的,安装方式之一就是在docs命令行里用adb install <apk绝对路径>命令去安装到连接到PC上的Android设备。
问题五:
Warning:Exception while processing task java.io.IOException: Can't write [G:JingYeProjectJingYeApplicationJingYeLogisticsuildintermediates ransformsproguard91 eleasejars31fmain.jar] (Can't read [C:Userslenovo.gradlecachesmodules-2files-2.1com.umeng.analyticsanalytics6.1.14bff754fc05336940a8cb348e455c01515b5d883analytics-6.1.1.jar(;;;;;;**.class)] (Duplicate zip entry [analytics-6.1.1.jar:com/umeng/analytics/pro/cq$1.class]))
IOException: Can't write eleasejars31fmain.jar Can't read modules-2files-2.1com.umeng.analyticsanalyticsanalytics-6.1.1.jar(;;;;;;**.class) (Duplicate zip entry [analytics-6.1.1.jar:com/umeng/analytics/pro/cq$1.class]))
http://bbs.umeng.com/thread-5446-1-1.html
compile 'com.umeng.analytics:analytics:latest.integration'
和umeng的两个jar包,采用其中一种形式就可以。
问题四(已解决):
Warning:Exception while processing task java.io.IOException: The same input jar [G:JingYeProjectJingYeApplicationJingYeLogisticslibsumeng-analytics-v6.1.1.jar] is specified twice.
compile files('libs/umeng-analytics-v6.1.1.jar')
需要在build.gradle文件中添加上上面导入jar包的语句。
Exception while processing task java.io.IOException: The same input jar is specified twice.
http://blog.csdn.net/ylbf_dev/article/details/50448727
解决方法如下:
打开 proguard.cfg
在所有的-libraryjars 前插入 # 成 #-libraryjars xxxx.jar
原因分析
原因是build.gradle文件配置了dependencies { compile fileTree(include: '*.jar', dir: 'libs')}里面已经添加过jar包,混淆文件proguard.cfg里面又加了句-libraryjars libs/***.jar,将-libraryjars libs/***.jar 前面用#号注释或者直接删掉即可。
sdk 通过 proguard 混淆代码时默认已经将 lib目录中的 jar 都已经添加到打包脚本中,所以不需要再次手动添加。
问题三:
Warning:okio.Okio: can't find referenced class java.nio.file.Files
Warning:okio.Okio: can't find referenced class java.nio.file.Path
Warning:okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning:okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:there were 15 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Can't write [G:JingYeProjectJingYeApplicationJingYeLogisticsuildintermediates ransformsproguard91 eleasejars31fmain.jar] (Can't read [C:Userslenovo.gradlecachesmodules-2files-2.1com.umeng.analyticsanalytics6.1.14bff754fc05336940a8cb348e455c01515b5d883analytics-6.1.1.jar(;;;;;;**.class)] (Duplicate zip entry [analytics-6.1.1.jar:com/umeng/analytics/pro/cq$1.class]))
Error:Execution failed for task ':JingYeLogistics:transformClassesAndResourcesWithProguardFor91Release'.> Job failed, see logs for details
(2)问:警告io的,将okio避免混淆就可以了
Error:Execution failed for task 'transformClassesAndResourcesWithProguardFor91Release'.> Job failed, see logs for details
(1)问:Warning:com.amap.api.mapcore2d.aq: can't find referenced class com.amap.api.mapcore2d.MapMessage
按照下面的博客解决问题:
http://blog.csdn.net/u010636574/article/details/44015763
Amap_2DMap_V4.2.0_20170209.jar
AMap_Location_V3.4.0_20170427.jar
AMap_Search_V5.1.0_20170517.jar
Android_Map3D_SDK_V5.2.0_20170602.jar
umeng-analytics-v6.1.1.jar
utdid4all-1.0.4.jar