解决android打包dex文件方法数溢出的问题
2017-01-23 16:02
435 查看
apply
plugin:
'com.android.application'
android {
compileSdkVersion
19
buildToolsVersion
'23.0.1'
defaultConfig {
applicationId
"com.shjy.jingin"
minSdkVersion
14
targetSdkVersion
21
versionCode
1
versionName
"1.0"
multiDexEnabled
true // add this
}
buildTypes {
release {
minifyEnabled
false
proguardFiles getDefaultProguardFile(
'proguard-android.txt'),
'proguard-rules.pro'
}
}
dexOptions { // add this 不加入会内存溢出
incremental
true
javaMaxHeapSize
"4g"
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
packagingOptions {
exclude
'META-INF/DEPENDENCIES'
exclude
'META-INF/LICENSE'
exclude
'META-INF/LICENSE.txt'
exclude
'META-INF/license.txt'
exclude
'META-INF/NOTICE'
exclude
'META-INF/NOTICE.txt'
exclude
'META-INF/notice.txt'
exclude
'META-INF/ASL2.0'
exclude
'META-INF/DEPENDENCIES'
exclude
'META-INF/NOTICE'
exclude
'META-INF/LICENSE'
}
}
dependencies {
compile
'com.android.support:multidex:' // add this
compile fileTree(dir:
'libs',
include: ['*.jar'])
compile project(':swipelistview'
)
compile project(':library'
)
compile project(':android-support-v7-appcompat'
)
}
plugin:
'com.android.application'
android {
compileSdkVersion
19
buildToolsVersion
'23.0.1'
defaultConfig {
applicationId
"com.shjy.jingin"
minSdkVersion
14
targetSdkVersion
21
versionCode
1
versionName
"1.0"
multiDexEnabled
true // add this
}
buildTypes {
release {
minifyEnabled
false
proguardFiles getDefaultProguardFile(
'proguard-android.txt'),
'proguard-rules.pro'
}
}
dexOptions { // add this 不加入会内存溢出
incremental
true
javaMaxHeapSize
"4g"
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
packagingOptions {
exclude
'META-INF/DEPENDENCIES'
exclude
'META-INF/LICENSE'
exclude
'META-INF/LICENSE.txt'
exclude
'META-INF/license.txt'
exclude
'META-INF/NOTICE'
exclude
'META-INF/NOTICE.txt'
exclude
'META-INF/notice.txt'
exclude
'META-INF/ASL2.0'
exclude
'META-INF/DEPENDENCIES'
exclude
'META-INF/NOTICE'
exclude
'META-INF/LICENSE'
}
}
dependencies {
compile
'com.android.support:multidex:' // add this
compile fileTree(dir:
'libs',
include: ['*.jar'])
compile project(':swipelistview'
)
compile project(':library'
)
compile project(':android-support-v7-appcompat'
)
}
相关文章推荐
- Android Gson 解析泛型报错
- android动态背景色圆形头像
- Android相机Camera基础知识
- 一个实例让你透彻理解Android ViewGroupe的事件分发
- Android数据存储方式
- android中的索引列表
- Android体系介绍
- Android四大组件学习之BroadcastReceiver
- Android点击EditText文本框之外任何地方隐藏键盘的解决办法
- 哇!!SurfaceView 4 android~
- Android四大组件学习之ContentProvider
- Android四大组件学习之Service
- Android四大组件学习之Activity
- 浅谈Android MVP模式
- 设计模式学习
- 掌握android studio项目结构
- android样式和主题
- Android获取栈顶Activity/查看应用使用情况(适配Android6.0)
- Android 使用ContentProvider ContentResolver 实现增删改查
- android使用经验