Pārlūkot izejas kodu

修改dex分包工具

xieshengqi 5 gadi atpakaļ
vecāks
revīzija
21a227a78d

+ 3 - 3
app/build.gradle

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

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

@@ -45,6 +45,11 @@ public class App extends Application {
45 45
     public static Context context;
46 46
 
47 47
     @Override
48
+    protected void attachBaseContext(Context base) {
49
+        super.attachBaseContext(base);
50
+    }
51
+
52
+    @Override
48 53
     public void onCreate() {
49 54
         super.onCreate();
50 55
 

+ 5 - 3
common/build.gradle

@@ -9,7 +9,7 @@ android {
9 9
         targetSdkVersion 28
10 10
         versionCode 2
11 11
         versionName "2.0"
12
-
12
+        multiDexEnabled true
13 13
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 14
 
15 15
     }
@@ -19,7 +19,9 @@ android {
19 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 27
 dependencies {
@@ -51,7 +53,7 @@ dependencies {
51 53
     //加载框
52 54
     implementation 'com.github.gittjy:LoadingDialog:1.0.2'
53 55
 
54
-
56
+    implementation 'com.android.support:multidex:1.0.1'
55 57
     // 基础依赖包,必须要依赖
56 58
     implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta05'
57 59
 // fragment快速实现(可选)

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

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

+ 1 - 0
factory/build.gradle

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