使用React Native Android的SoLoader $ WrongAbiError

最近,我们已经整合了我们的应用程序,只有你好世界观。 在一些设备(主要是华硕)我们得到这个崩溃。

Fatal Exception: com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:253) at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:24) at com.facebook.react.bridge.ReactBridge.<clinit>(ReactBridge.java:20) at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:22) at com.facebook.react.JSCConfig$1.getConfigMap(JSCConfig.java:14) at com.facebook.react.XReactInstanceManagerImpl.recreateReactContextInBackgroundFromBundleLoader(XReactInstanceManagerImpl.java:423) at com.facebook.react.XReactInstanceManagerImpl.recreateReactContextInBackgroundInner(XReactInstanceManagerImpl.java:419) at com.facebook.react.XReactInstanceManagerImpl.createReactContextInBackground(XReactInstanceManagerImpl.java:363) at com.facebook.react.ReactRootView.startReactApplication(ReactRootView.java:213) at com.eightfit.app.ui.fragments.ReactFragment.startReactApp(ReactFragment.java:107) at com.eightfit.app.ui.fragments.ReactFragment.onViewCreated(ReactFragment.java:88) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1123) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671) at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619) at com.eightfit.app.ui.activities.MainActivity.onStart(MainActivity.java:150) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) at android.app.Activity.performStart(Activity.java:5241) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273) at android.app.ActivityThread.access$800(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5045) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(NativeStart.java) Caused by java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app-lib/com.eightfit.app-1/libreactnativejni.so" has unexpected e_machine: 40 at java.lang.Runtime.load(Runtime.java:333) at java.lang.System.load(System.java:512) at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:71) at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:42) at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:299) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:247) at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:24) at com.facebook.react.bridge.ReactBridge.<clinit>(ReactBridge.java:20) at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:22) at com.facebook.react.JSCConfig$1.getConfigMap(JSCConfig.java:14) at com.facebook.react.XReactInstanceManagerImpl.recreateReactContextInBackgroundFromBundleLoader(XReactInstanceManagerImpl.java:423) at com.facebook.react.XReactInstanceManagerImpl.recreateReactContextInBackgroundInner(XReactInstanceManagerImpl.java:419) at com.facebook.react.XReactInstanceManagerImpl.createReactContextInBackground(XReactInstanceManagerImpl.java:363) at com.facebook.react.ReactRootView.startReactApplication(ReactRootView.java:213) at com.eightfit.app.ui.fragments.ReactFragment.startReactApp(ReactFragment.java:107) at com.eightfit.app.ui.fragments.ReactFragment.onViewCreated(ReactFragment.java:88) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1123) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671) at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619) at com.eightfit.app.ui.activities.MainActivity.onStart(MainActivity.java:150) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) at android.app.Activity.performStart(Activity.java:5241) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273) at android.app.ActivityThread.access$800(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5045) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(NativeStart.java) 

在gradle中,我们用这种方式定义Android NDK abifilter

 ndk { abiFilters "armeabi", "armeabi-v7a", "mips", "x86" } 

我们使用React Native 0.35.0-rc.0但是在稳定版本0.33.1我们也得到了相同的崩溃。

受影响的华硕设备使用cpu abi armeabi-v7a 。 大多数其他设备具有相同的abi似乎工作正常。

在这里输入图像说明

你可以在这里find完整的崩溃报告。 https://gist.github.com/sealskej/5fc0c8e9092721d2be43b4d1ff3c60de

任何帮助导致解决问题将不胜感激!

Solutions Collecting From Web of "使用React Native Android的SoLoader $ WrongAbiError"