0
我們正在試圖整合反應本土到我們現有的Android應用程序: 我們的build.gradle的SDK要求是:集成中的反應本土到現有的應用程序
minSdkVersion 16
targetSdkVersion 23
我們使用一個Intent調用初始反應index.js:
Intent inte = new Intent(this, ReactNativeStarter.class);
startActivity(inte);
的代碼的其餘部分是從反應積分教程。
當我們試圖撥打我們的反應成分,我們得到以下錯誤:
12-16 09:37:52.041 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
Process: XXXXX, PID: XXXX
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libfbjni.so" needed by "libreactnativejni.so"; caused by cannot locate symbol "_ZSt16__get_once_mutexv" referenced by "libfbjni.so"...
at java.lang.Runtime.load(Runtime.java:331)
at java.lang.System.load(System.java:982)
at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:63)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:209)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:178)
at com.facebook.react.bridge.JSCJavaScriptExecutor.<clinit>(JSCJavaScriptExecutor.java:25)
at com.facebook.react.bridge.JSCJavaScriptExecutor$Factory.create(JSCJavaScriptExecutor.java:20)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:183)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:169)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
你能幫忙嗎?
解決該問題是通過更改excludeOptions首先在packagingOptions中解決。因爲我們有一個新的反應原生錯誤: 由:java.lang.IllegalAccessError引起:方法'無效android.support.v4.net.ConnectivityManagerCompat。()'無法訪問類com.facebook.react.modules.netinfo.NetInfoModule' ('com.facebook.react.modules.netinfo.NetInfoModule'的聲明出現在/ data/data/at中。 ???/files/instant-run/dex/slice-com.facebook.react-react-native-0.20.1_3762d580ab3ced1fa2f7503493d38e666994b9fa-classes.dex) –
NeETsu
你解決了那個錯誤嗎? – swalkner
你好 是的。該問題已通過添加pickFirst instad的Exclude for the library來解決 – NeETsu