日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

發布時間:2024/9/30 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一:問題描述:

? ? 應用中的Dex 文件方法數超過了最大值65536的上限,簡單來說,應用爆棚了.

?

二、解決方案:

? ? ?方案1:使用插件化框架 ?比如:?https://github.com/singwhatiwanna/dynamic-load-apk

? ? 方案2:分割Dex

?

三:分割 Dex 文件實現方法?

? ? ?1、相關鏈接

? ? ?https://developer.android.com/tools/building/multidex.html#about

? ? ?2、在app的 build.gradle 中

? ? ? ? ?(1)在dependencies 中添加 ?

? ? ? ? ? ? ? ? compile 'com.android.support:multidex:1.0.1'

? ? ? ? ?(2)在?defaultConfig 中添加

? ? ? ? ? ? ? ? multiDexEnabled true

? ? ? ? ? ? ? ? ? ? ?比如 ??

1 defaultConfig { 2 applicationId "com.pegasus.map" 3 minSdkVersion 15 4 targetSdkVersion 23 5 versionCode 1 6 versionName "1.0" 7 signingConfig signingConfigs.config 8 multiDexEnabled true 9 }

? ? ? ? ?(3)在 AndroidManifest.xml 中的 ?application 標簽中添加?? ? ? ? ? ??

1 <?xml version="1.0" encoding="utf-8"?> 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 package="com.example.android.multidex.myapplication"> 4 <application 5 ... 6 android:name="android.support.multidex.MultiDexApplication"> 7 ... 8 </application> 9 </manifest>

? ?提示:如果你的應用程序繼承 Application , 那么你需要重寫?? ??

1 @Override 2 protected void attachBaseContext(Context base) { 3 super.attachBaseContext(base); 4 MultiDex.install(this) ; 5 }

?

另外我的微信公眾賬號是: zhaoyanjun125 ?

我會經常發一些我的些項目的感悟和編程技術。歡迎關注。

?微信掃描二維碼 關注我

??

?

?

?

?

? ? ? ??

?

總結

以上是生活随笔為你收集整理的如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。