Skip to content

Instantly share code, notes, and snippets.

@shihabmi7
Last active November 28, 2016 14:23
Show Gist options
  • Save shihabmi7/b69bd89c951e639ceb63aba064ea50dc to your computer and use it in GitHub Desktop.
Save shihabmi7/b69bd89c951e639ceb63aba064ea50dc to your computer and use it in GitHub Desktop.
Multidex Enable
public class YourApplication extends Application {
@Override
protected void attachBaseContext(Context context) {
super.attachBaseContext(context);
MultiDex.install(this);
}
@Override
public void onCreate() {
super.onCreate();
Realm.init(this); //initialize other plugins
}
}�
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.alhikmah.taxidriver"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:24.2.1'
compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name=".YourApplication">
...
</application>
</manifest>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment