解决安卓编译 the 64K Reference Limit
来源:互联网 发布:低价已备案域名 编辑:程序博客网 时间:2024/06/14 20:07
关于64k 引用限制的说明
Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536—including Android framework methods, library methods, and methods in your own code. In the context of computer science, the term Kilo, K, denotes 1024 (or 2^10). Because 65,536 is equal to 64 X 1024, this limit is referred to as the '64K reference limit'.
Getting past this limit requires that you configure your app build process to generate more than one DEX file, known as amultidex configuration.
解决方法如下
Versions of the platform prior to Android 5.0 (API level 21) use the Dalvik runtime for executing app code. By default, Dalvik limits apps to a single classes.dex bytecode file per APK. In order to get around this limitation, you can use themultidex support library, which becomes part of the primary DEX file of your app and then manages access to the additional DEX files and the code they contain.
The Android plugin for Gradle available in Android SDK Build Tools 21.1 and higher supports multidex as part of your build configuration. Make sure you update the Android SDK Build Tools tools and the Android Support Repository to the latest version using the SDK Manager before attempting to configure your app for multidex.
Setting up your app development project to use a multidex configuration requires that you make a few modifications to your app development project. In particular you need to perform the following steps:
- Change your Gradle build configuration to enable multidex
- Modify your manifest to reference the
MultiDexApplication
class
Modify the module-level build.gradle
file configuration to include the support library and enable multidex output, as shown in the following code snippet:
android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { ... minSdkVersion 14 targetSdkVersion 21 ... // Enabling multidex support. multiDexEnabled true } ...}dependencies { compile 'com.android.support:multidex:1.0.0'}
In your manifest add the MultiDexApplication
class from the multidex support library to the application element.
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application></manifest>
- 解决安卓编译 the 64K Reference Limit
- Bypassing the 64K pipe buffer limit
- Building the System 编译安卓系统
- THE DEX 64K LIMIT IS NOT A PROBLEM ANYMORE, ALMOST
- 安卓编译SDK错误和解决
- Android Dex 64k Method Size Limit
- linux编译,解决类似于undefined reference to `*'
- POJ 3620 Avoid The Lakes【DFS水题练格式Avoid The Lakes Time Limit: 1000MSMemory Limit: 65536K Total Sub】
- 解决Android Studio编译时出现GC overhead limit exceeded
- 安卓系统编译错误——解决
- 安卓源码项目进行gradle编译改造常见问题解决
- 安卓Gradle编译失败问题分析及解决
- the directory item limit is exceed: limit=1048576问题的解决
- LIMIT=limit*4k+0fffh
- 預防 Android Dex 64k Method Size Limit
- 预防 Android Dex 64k Method Size Limit
- sqlite3 交叉编译 undefined reference to `fdatasync' 错误解决
- 解决gcc 编译时报错"undefined reference to 'main'" 问题
- Swift学习 二
- 史上最简单的C语言链表实现,没有之一
- redis学习笔记(7)---压缩字典zipmap
- 完全背包 2016.5.8
- 中文分词工具Jieba
- 解决安卓编译 the 64K Reference Limit
- Android自定义控件(特效一) 点击屏幕,根据所点击的位置绘制圆环
- matlab打开和生成使用.p文件和exe文件
- linux下ffmpeg安装
- cocos2dx 3.10 读取加密压缩ZIP文件
- SQLite可视化管理工具汇总
- 欢迎使用CSDN-markdown编辑器
- 第十一周实践项目1.1-点-圆-圆柱类族的设计
- Caffe利用测试好的模型测试图片以及每层的可视化