Android一点 精简google-play-services.jar

如果在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


关于Google Play services的各个分支介绍(MX5一定要安装XXXXXX-448分支) 要想使用google playgoogle map等google应用,就必须安装Google Play Service,但Google Play Service有太多分支了,最近终于搞明白各个分支代表什么。 版本号最后三位(2104405-XYZ)分别表示Android版本,cpu的arm系列,屏幕密度(DPI)。 下面是具体分支介绍: Notes / What's New Uploader's notes: To figure out the right version of Google Play services for your Android device, go to Settings -> Apps -> Google Play services, and look at the last 3 numbers in the parentheses. You'll see something like -XYZ where: 1.第一位X * X defines Android version: 0 for Android =5.0 // 4和7表示Android5.0及以上 8 for Android TV // 8表示Android电视应用 2.第二位Y * Y defines CPU architecture: 1 for armeabi 3 for armeabi-v7a // 32位版本 4 for arm64-v8a // 64位v8版本,MX5必须是这个 7 for x86 // x86主要是对intel cpu来说的 3.第三位Z * Z defines DPI: 0 for universal 2 for 160 4 for 240 6 for 320 8 for 480 // MX5选这个就行了 Notes: It seems that -7YZ builds became -4YZ with Google Play services 6.5. If you were on -7YZ before, you should now install -4YZ. Looks like -8YZ builds are for Android TV. Examples: -014 for Android <5.0 armeabi CPU 240 DPI device -438 for Android 5.0+ armeabi-v7a CPU 480 DPI device -876 for Android TV x86 CPU 320 DPI device 国内用户可以直接从以下镜像网站下载最新到Google Play Service http://www.apkmirror.com/apk/google-inc/google-play-services/ 目前最新版本是Google Play services 7.8.93 MX5用户可以安装以下分支: Google Play services 7.8.93 (2104405-448) http://www.apkmirror.com/apk/google-inc/google-play-services/google-play-services-7-8-93-2104405-448-android-apk-download/ 另外,安装后好需要禁止系统自带【应用中心】自动安装更新,可以设置面流量更新,但不要设置“静默安装更新包”,否则新版本发布后会自动更新成应用中心的最新版本,而最新版本的后三位可能不是你想要的分支,这时候就会导致弹出提示架构不符等。
mariadb-10.5.11-linux-mips64.tar.gz 是一个Mariadb数据库的安装文件,适用于MIPS64指令集架构的Linux操作系统。 MariaDB是MySQL数据库的一个分支,它保留了MySQL的大部分功能,并在其基础上进行了一些改进和优化。它是一种开源的关系型数据库管理系统,常用于构建高性能、可靠的数据库应用程序。 文件名中的“10.5.11”表示Mariadb的版本号为10.5.11。版本号中的第一个数字“10”代表大版本号,第二个数字“5”代表次版本号,第三个数字“11”代表修订版本号。通过版本号可以了解该文件对应的Mariadb版本的特性和功能。 “linux”表示该安装文件适用于Linux操作系统。Linux是一种自由和开放源代码的类Unix操作系统,广泛应用于服务器和嵌入式系统等领域。而且由于Linux系统的开源性和稳定性,很多开发人员和企业选择在Linux上部署数据库系统。 “mips64”表示该文件适用于基于MIPS64指令集架构的处理器。MIPS(Microprocessor without Interlocked Pipelined Stages)是一种常用的精简指令集(RISC)架构。而MIPS64是MIPS指令集的64位版本,提供更大的寻址空间和更高的性能。 “.tar.gz”表示该文件采用了Tar和Gzip的压缩方式。Tar(Tape Archive)是一种常见的文件归档格式,用于将多个文件打包成一个文件。Gzip是一种常用的数据压缩工具,用于减小文件的体积。结合使用Tar和Gzip可以有效地将文件进行打包和压缩,便于传输和存储。 因此,mariadb-10.5.11-linux-mips64.tar.gz是用于在基于MIPS64指令集架构的Linux系统上安装Mariadb数据库的压缩文件。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值