Reputation: 28
I'm trying to launch a fresh react-native init app, launching with react-native run-android
Build passes, the APK is installed on a device, but it crashes on launch. The logcat shows:
06-13 10:09:50.467 11106 11106 W System.err: java.lang.ClassNotFoundException: host.exp.exponent.ReactNativeStaticHelpers
06-13 10:09:50.469 11106 11106 W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "host.exp.exponent.ReactNativeStaticHelpers" on path: DexPathList[[zip file "/data/app/com.dummy-o3c6RDZQ-kC_ECVFF6RNOQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.dummy-o3c6RDZQ-kC_ECVFF6RNOQ==/lib/x86, /data/app/com.dummy-o3c6RDZQ-kC_ECVFF6RNOQ==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
06-13 10:09:50.470 11106 11106 E unknown:ReactNative: Bundle url format is invalid.
06-13 10:09:50.470 11106 11106 E unknown:ReactNative:
06-13 10:09:50.470 11106 11106 E unknown:ReactNative: java.net.MalformedURLException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
What's particularly interesting is I'm not using Expo on this project, but the error shows couldn't find host.exp.exponent.ReactNativeStaticHelpers, along with Bundle url format is invalid.
When ran on another Mac, it runs completely fine.
I've tried reinstalling react-native-cli, whole Android Studio and tools/SDK's, tried to run on multiple devices (both emulators and physical devices) to no avail.
Upvotes: 0
Views: 1017
Reputation: 491
- Most probably the problem is with the caching of this library as you were previously using expo:
Both of expo and react-native facebook libraries are similar in naming but different in code.
Solution: Remove the Facebook folder from "/home/$user/.m2/repository/com/facebook" then sync the project again to re-download the correct library.
Upvotes: 1