Skip to content

Commit 58cfa58

Browse files
authored
Update README.md
1 parent 75f6cc8 commit 58cfa58

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
**解决:**
1111
```
12+
android{
13+
defaultConfig {
14+
multiDexEnabled true
15+
}
16+
}
17+
1218
dependencies {
1319
compile 'com.android.support:MultiDex:1.0.1'
1420
}
@@ -107,24 +113,38 @@ afterEvaluate {
107113
于是乎就将Gradle脚本整合进了插件,这样只需维护一个配置文件就行了。读者可以根据自己需求自行选择分开配置还是整合配置。通过这种方式我们把主Dex的方法数维持在15000左右,从此再也不用担心方法数问题了!!!
108114

109115
##配置部分
110-
**第一步:添加根目录Gradle**
116+
**第一步:添加分包支持**
117+
```
118+
android{
119+
defaultConfig {
120+
multiDexEnabled true
121+
}
122+
}
123+
124+
dependencies {
125+
compile 'com.android.support:MultiDex:1.0.1'
126+
}
127+
在继承的 Application中重写 attachBaseContext(Context)
128+
129+
@Override
130+
protected void attachBaseContext(Context base) {
131+
super.attachBaseContext(base);
132+
MultiDex.install(this);
133+
}
134+
```
135+
**第二步:添加根目录Gradle**
111136
```
112137
buildscript {
113138
dependencies {
114139
classpath 'com.library.tangxiaolv:dexknife-plus:1.0.3'
115140
}
116141
}
117-
118-
Notes:Version Mappting
119-
1.0.3 -> DexKnifePlugin 1.6.0
120-
1.0.2 -> DexKnifePlugin 1.5.9
121-
1.0.1 -> DexKnifePlugin 1.5.6
122142
```
123-
**第二步:在你的App模块的build.gradle添加插件**
143+
**第三步:在你的App模块的build.gradle添加插件**
124144
```
125145
apply plugin: 'dexknifePlus'
126146
```
127-
**第三步:配置参数**
147+
**第四步:配置参数**  
128148
```
129149
dexKnife{
130150
//必选参数
@@ -144,7 +164,7 @@ dexKnife{
144164
* */
145165
}
146166
```
147-
**第四步:在你的App模块目录下新建dexknife.txt,并自定义配置**
167+
**第五步:在你的App模块目录下新建dexknife.txt,并自定义配置**
148168
```
149169
#为注释符
150170
@@ -179,7 +199,7 @@ dexKnife{
179199
#-log-mainlist
180200
```
181201

182-
**第五步:在 defaultConfig 或者 buildTypes中打开 multiDexEnabled true,否则不起作用**
202+
**第六步:在 defaultConfig 或者 buildTypes中打开 multiDexEnabled true,否则不起作用**
183203

184204
##已知错误
185205

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy