react-native-image-tools icon indicating copy to clipboard operation
react-native-image-tools copied to clipboard

Multidex error on android

Open srameshr opened this issue 7 years ago • 7 comments

MainApplication.java:46: error: cannot find symbol
    MultiDex.install(getBaseContext());
    ^
  symbol:   variable MultiDex
  location: class MainApplication

This is my MainAppllication.java file:

@Override
  public void onCreate() {
    super.onCreate();
    MultiDex.install(getBaseContext());
    AdobeCSDKFoundation.initializeCSDKFoundation(getApplicationContext());
    SoLoader.init(this, /* native exopackage */ false);
  }

srameshr avatar Jul 15 '17 14:07 srameshr

Looks like you're missing an import.

npomfret avatar Jul 23 '17 17:07 npomfret

I just removed this line MultiDex.install(getBaseContext()); and it works fine. Will I run into trouble later? I have no idea about native java code.

srameshr avatar Jul 24 '17 07:07 srameshr

You app won't start if DEXing is an issue, but it's easy enough to overcome.

npomfret avatar Jul 24 '17 07:07 npomfret

Il go over this again and update this thread if I manage to fix my issue in a proper way.

srameshr avatar Jul 24 '17 08:07 srameshr

Did anyone resolve this issue?

flyandi avatar Aug 09 '17 15:08 flyandi

Followed the install instructions and faced the same issue. As what the contributor said, an import is missing. Install.md did not include the import for the multidex so you will need to add that by yourself.

@flyandi Add this to your MainApplication.java and it will works: import android.support.multidex.MultiDex;

anniewey avatar Sep 29 '17 00:09 anniewey

Remember to also pull in Context: import android.content.Context; for the attachBaseContext(Context base) method

nwaughachukwuma avatar Oct 12 '18 16:10 nwaughachukwuma