Browse Source

修改dex分包工具

xieshengqi 5 years ago
parent
commit
21a227a78d

+ 3 - 3
app/build.gradle

15
         applicationId "com.smileflowpig.money"
15
         applicationId "com.smileflowpig.money"
16
         minSdkVersion 19
16
         minSdkVersion 19
17
         targetSdkVersion 28
17
         targetSdkVersion 28
18
-        versionCode 14
19
-        versionName "2.2.1"
18
+        versionCode 15
19
+        versionName "2.2.2"
20
         multiDexEnabled true
20
         multiDexEnabled true
21
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
22
     }
22
     }
235
         implementation 'com.alibaba:fastjson:1.1.70.android'
235
         implementation 'com.alibaba:fastjson:1.1.70.android'
236
         implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
236
         implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
237
         implementation project(':ocr_ui')
237
         implementation project(':ocr_ui')
238
-
238
+        implementation 'com.android.support:multidex:1.0.1'
239
         // 基础依赖包,必须要依赖
239
         // 基础依赖包,必须要依赖
240
         implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta05'
240
         implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta05'
241
 // fragment快速实现(可选)
241
 // fragment快速实现(可选)

+ 5 - 0
app/src/main/java/com/smileflowpig/money/moneyplatfrom/App.java

45
     public static Context context;
45
     public static Context context;
46
 
46
 
47
     @Override
47
     @Override
48
+    protected void attachBaseContext(Context base) {
49
+        super.attachBaseContext(base);
50
+    }
51
+
52
+    @Override
48
     public void onCreate() {
53
     public void onCreate() {
49
         super.onCreate();
54
         super.onCreate();
50
 
55
 

+ 5 - 3
common/build.gradle

9
         targetSdkVersion 28
9
         targetSdkVersion 28
10
         versionCode 2
10
         versionCode 2
11
         versionName "2.0"
11
         versionName "2.0"
12
-
12
+        multiDexEnabled true
13
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14
 
14
 
15
     }
15
     }
19
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20
         }
20
         }
21
     }
21
     }
22
-
22
+    dexOptions{
23
+        preDexLibraries = false
24
+    }
23
 }
25
 }
24
 
26
 
25
 dependencies {
27
 dependencies {
51
     //加载框
53
     //加载框
52
     implementation 'com.github.gittjy:LoadingDialog:1.0.2'
54
     implementation 'com.github.gittjy:LoadingDialog:1.0.2'
53
 
55
 
54
-
56
+    implementation 'com.android.support:multidex:1.0.1'
55
     // 基础依赖包,必须要依赖
57
     // 基础依赖包,必须要依赖
56
     implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta05'
58
     implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta05'
57
 // fragment快速实现(可选)
59
 // fragment快速实现(可选)

+ 10 - 1
common/src/main/java/com/smileflowpig/money/common/app/Application.java

1
 package com.smileflowpig.money.common.app;
1
 package com.smileflowpig.money.common.app;
2
 
2
 
3
+import android.content.Context;
3
 import android.os.SystemClock;
4
 import android.os.SystemClock;
4
 import android.support.annotation.StringRes;
5
 import android.support.annotation.StringRes;
6
+import android.support.multidex.MultiDex;
7
+import android.support.multidex.MultiDexApplication;
5
 import android.widget.Toast;
8
 import android.widget.Toast;
6
 
9
 
7
 import com.smileflowpig.money.common.utils.DisplayUtil;
10
 import com.smileflowpig.money.common.utils.DisplayUtil;
17
  * @author HFRX hfrx1314@qq.com
20
  * @author HFRX hfrx1314@qq.com
18
  * @version 1.0.0
21
  * @version 1.0.0
19
  */
22
  */
20
-public class Application extends android.app.Application {
23
+public class Application extends MultiDexApplication {
21
     private static Application instance;
24
     private static Application instance;
22
 
25
 
23
     @Override
26
     @Override
27
+    protected void attachBaseContext(Context base) {
28
+        super.attachBaseContext(base);
29
+        MultiDex.install(this);
30
+    }
31
+
32
+    @Override
24
     public void onCreate() {
33
     public void onCreate() {
25
         super.onCreate();
34
         super.onCreate();
26
         instance = this;
35
         instance = this;

+ 1 - 0
factory/build.gradle

43
     implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
43
     implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
44
     implementation project(':lang')
44
     implementation project(':lang')
45
 
45
 
46
+    implementation 'com.android.support:multidex:1.0.1'
46
     implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
47
     implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
47
     implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
48
     implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
48
     implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
49
     implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'