add this line to the manifest file
<application ... android:name="android.support.multidex.MultiDexApplication"> ... </application>
and also add this to your gradle
defaultConfig { ... minSdkVersion 14 targetSdkVersion 21 ... // Enabling multidex support. multiDexEnabled true }
second solution:
add this to your onCreate () launch activity
public void onCreate(Bundle arguments) { Context context = this.getInstrumentation().getTargetContext().getApplicationContext(); MultiDex.install(context ); super.onCreate(arguments); ... }
or
you need to add this to the class that extends Application:
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); }
for more details: link 1 , link 2 , link 3 , link 4
Hope this works.
source share