Skip to content

Instantly share code, notes, and snippets.

@surendharreddy
Last active September 28, 2018 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save surendharreddy/420b9d608f3dab53e73e67479fe92bbd to your computer and use it in GitHub Desktop.
Save surendharreddy/420b9d608f3dab53e73e67479fe92bbd to your computer and use it in GitHub Desktop.
Fixes for React Native most common errors.

[Android] app crashes with Fatal Exception: java.lang.NoClassDefFoundError okhttp3.OkHttpClient$Builder

/* Add following dependency to dependencies in android/app/build.gradle */ implementation 'com.android.support:multidex:1.0.3'

Import the following dependencies in MainApplication.java import android.support.multidex.MultiDex; import android.content.Context;

and add

@Override
protected void attachBaseContext(Context base) {
  super.attachBaseContext(base);
  MultiDex.install(this);
}

Use legacy build system in XCode 10 to avoid build errors in React Native.

facebook/react-native#20774 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment