1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
报错:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.dex.DexIndexOverflowException:
Cannot merge new index 66685 into a non-jumbo instruction!
报错:
ProcessException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
app/build.gradle 所需核心配置如下
```
android {
defaultConfig {
multiDexEnabled true
}
buildTypes {
release {
//分包
multiDexEnabled true
}
}
//如果引用的第三方库的支持库版本低于(或者不一致)app build.gradle中的支持库版本
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support' ) {
if (!requested.name.startsWith( "multidex" )) {
details.useVersion '26.1.0' //使用希望加载的库版本
}
}
}
}
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
preDexLibraries = false
}
}
dependencies {
compile "com.android.support:multidex:1.0.1"
}
```
Application继承MultiDexApplication或者在已有继承Application中设置
@Override
protected void attachBaseContext(Context base) {
super .attachBaseContext(base);
MultiDex.install(base);
}
问题:Error:Error converting bytecode to dex:Cause: com.android.dex.DexException:
解决:手动删除app/build文件夹
发布签名包时需要足够的内存
参考 https: //www.cnblogs.com/yutingliuyl/p/7117756.html
https: //blog.csdn.net/qq_30552993/article/details/75355492
|
有任何疑问或技术合作都可联系我
微信:yanfahezuo 【推荐】
QQ:596957738