Android compatibility issue with third-party libraries after detach

I am not very familiar with java/Android development but I find something that might be related to the issue. So I post here to ask for opinion/help.

I am using create-react-native-app to eject with ExpoKit. After eject, the includes a class MainApplication which extends MultiDexApplication. If I eject with normal react-native project, the same class extends Application as well as implements ReactApplication. This interface needs to implement getReactNativeHost method which returns a ReactNativeHost.

Some libraries expect that the MainApplication is a React application which has a getReactNativeHost. For example:

The app crashes when run into these lines. So my questions are:

  1. Why implementation of is different between expo and plain react-native?
  2. How can I use those libraries with ExpoKit?

Last time I tried with expo sdk 23.

I just tired with sdk 24 and got the same problem. Now MainApplication extends ExpoApplication which is not implementing ReactApplication and hence the same error occurs.

1 Like