File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed 
build-artifacts/project-template-gradle/app/src/main/java/com/tns Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11package  com .tns ;
22
33import  android .app .Application ;
4+ import  android .os .Build ;
5+ import  android .support .multidex .MultiDex ;
46
57public  class  NativeScriptApplication  extends  Application  {
68
@@ -23,6 +25,14 @@ public void onCreate() {
2325        }
2426    }
2527
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+ 
2636    public  static  Application  getInstance () {
2737        return  thiz ;
2838    }
Original file line number Diff line number Diff line change @@ -198,6 +198,8 @@ dependencies {
198198    if  (project. hasProperty(" supportVersion" 
199199        supportVer =  supportVersion
200200    }
201+ 
202+     compile " com.android.support:multidex:1.0.2" 
201203    compile " com.android.support:support-v4:$supportVer  " 
202204    compile " com.android.support:appcompat-v7:$supportVer  " 
203205    debugCompile " com.android.support:design:$supportVer  " 
@@ -272,7 +274,7 @@ task addDependenciesFromAppResourcesLibraries {
272274            println  " \t  + adding jar plugin dependency: $jarFileAbsolutePath  " 
273275            pluginsJarLibraries. add(jarFile. getAbsolutePath())
274276        }
275-          
277+ 
276278        project. dependencies. add(" compile" 
277279    }
278280}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments