Android一点 精简google-play-services.jar
来源:互联网 发布:花返网络股份有限公司 编辑:程序博客网 时间:2024/05/19 03:41
如果在eclipse上使用google-play-services.jar,最新的有5m多,很多的类库我们使用不到,这样在工程上就容易报65k,具体log如下:
[2016-11-21 17:43:13 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536[2016-11-21 17:43:13 - MHUniSDKExample] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
如果使用的Android studio请使用google推荐的com.android.support:multidex
eclipse的这里:精简 ads、pay、g+用到的库
1、需要用到gradle来构建
2、在build.gradle加上
task repack(){ tasks.create(name: "GDPlayServices", type: Jar) { destinationDir = new File("/test")//生成新的jar包的存储位置 archiveName = "google-play-services-gd.jar" //新jar包的名称 from(zipTree(new File("/test/google-play-services.jar"))) { //用到的package include "com/google/android/gms/wearable/**" include "com/google/android/gms/common/**" include "com/google/android/gms/internal/**" include "com/google/android/gms/wallet/**" include "com/google/android/gms/plus/**" include "com/google/android/gms/auth/**" include "com/google/android/gms/identity/intents/**" include "com/google/android/gms/signin/internal/**" include "com/google/ads/**" include "com/google/android/gms/ads/**" include "com/google/android/gms/analytics/**" include "com/google/android/gms/gcm/**" } }.execute()}//gradlew repack
3、在Terminal中执行
gradlew repack
0 0
- Android一点 精简google-play-services.jar
- 引用 google-play-services.jar
- 精简google-play-services.jar的方法(解决65536问题的应急方案)
- 官方推荐:精简google-play-services.jar的方法(解决65536问题的应急方案)
- Android:Google Play Services 4.2
- Android Google Services Framework & Google Play
- Google Play Services to Beat Android Fragmentation
- Google Play Game Services
- Google Play Services
- Google Play Services学习
- Google Play services工程
- Google Play Services SDK
- Android:Google Play services and OAuth Identity Tools
- android 中添加 Google Play Game Services 功能 1
- Android SDK中找不到Google Play Services解决方法
- unity android 退出异常 google play game services
- Google Play Game Services LeaderBoard
- Android:New Google Maps Android API now part of Google Play services
- Sobel锐化图像
- centos7服务器配置文档
- 01 神经病啊,你是这样的js—.—数组定义
- Android自定义控件一般步骤
- 程序员如何管理自己的代码
- Android一点 精简google-play-services.jar
- 妙算(树莓派等linux系统)程序开机自启动
- iOS使用HTTPS
- TCP运输连接管理
- 线程编译问题(undefined reference to `pthread_create')
- css强制换行、超出隐藏和限制行数
- mysql创建定时器(event),查看定时器,打开定时器,设置定时器时间
- Bootstrap3 表格-带边框的表格
- 第十三周项目2-Kruskal算法的验证