File tree 2 files changed +13
-1
lines changed
build-artifacts/project-template-gradle/app/src/main/java/com/tns
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com .tns ;
2
2
3
3
import android .app .Application ;
4
+ import android .os .Build ;
5
+ import android .support .multidex .MultiDex ;
4
6
5
7
public class NativeScriptApplication extends Application {
6
8
@@ -23,6 +25,14 @@ public void onCreate() {
23
25
}
24
26
}
25
27
28
+ public void attachBaseContext (android .content .Context base ) {
29
+ super .attachBaseContext (base );
30
+ if (Build .VERSION .SDK_INT < 21 ) {
31
+ // As the new gradle plugin automatically uses multidex if necessary we need to call this for older android API versions
32
+ MultiDex .install (this );
33
+ }
34
+ }
35
+
26
36
public static Application getInstance () {
27
37
return thiz ;
28
38
}
Original file line number Diff line number Diff line change @@ -198,6 +198,8 @@ dependencies {
198
198
if (project. hasProperty(" supportVersion" )) {
199
199
supportVer = supportVersion
200
200
}
201
+
202
+ compile " com.android.support:multidex:1.0.2"
201
203
compile " com.android.support:support-v4:$supportVer "
202
204
compile " com.android.support:appcompat-v7:$supportVer "
203
205
debugCompile " com.android.support:design:$supportVer "
@@ -272,7 +274,7 @@ task addDependenciesFromAppResourcesLibraries {
272
274
println " \t + adding jar plugin dependency: $jarFileAbsolutePath "
273
275
pluginsJarLibraries. add(jarFile. getAbsolutePath())
274
276
}
275
-
277
+
276
278
project. dependencies. add(" compile" , jarFiles)
277
279
}
278
280
}
You can’t perform that action at this time.
0 commit comments