Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating react-native into existing App #11485

Closed
NeETsu opened this issue Dec 15, 2016 · 4 comments
Closed

Integrating react-native into existing App #11485

NeETsu opened this issue Dec 15, 2016 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@NeETsu
Copy link

NeETsu commented Dec 15, 2016

Hi,

we are trying to integrate react-native into our existing android application:
The SDK requirements of our build.gradle are:
minSdkVersion 16
targetSdkVersion 23

We use an Intent to call the initial React index.js:
Intent inte = new Intent(this, ReactNativeStarter.class);
startActivity(inte);
The rest of the code is from the react integrating tutorial.

When we try to call our react component we get the following error:

E/art: dlopen("/data/app/lib/arm/libreactnativejni.so", RTLD_LAZY) failed: 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"...
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask

Can you help?

@NeETsu
Copy link
Author

NeETsu commented Dec 15, 2016

If i inite the SoLoader on false i get exact the same error.
If i inite the SoLoader on true i get:
java.lang.UnsatisfiedLinkError: could find DSO to load: libreactnativejni.so
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:213)

In error i also have the part:
java.lang.RuntimeException: An error occured while executing doInBackground()

In my opinion using the SoLoader doesn't make sense.

@NeETsu
Copy link
Author

NeETsu commented Dec 16, 2016

Update to the Request.
Full Error Code:

12-16 09:37:52.041 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask
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.(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) 

@NeETsu
Copy link
Author

NeETsu commented Dec 19, 2016

After long search and trying many different things i found that the error was found in grade by excluding in:

packagingOptions {
        exclude 'lib/armeabi-v7a/libgnustl_shared.so'
    }

to solve the issue we used:

packagingOptions {
        pickFirst 'lib/armeabi-v7a/libgnustl_shared.so'
    }

Now we have a new error:
12-19 10:07:22.157 30271-32680/at.???? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
Process: at.?????, PID:
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.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule'
(declaration of 'com.facebook.react.modules.netinfo.NetInfoModule' appears in /data/data/at.??????/files/instant-run/dex/slice-com.facebook.react-react-native-0.20.1_3762d580ab3ced1fa2f7503493d38e666994b9fa-classes.dex)
at com.facebook.react.modules.netinfo.NetInfoModule.(NetInfoModule.java:55)
at com.facebook.react.shell.MainReactPackage.createNativeModules(MainReactPackage.java:67)
at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:793)
at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:730)
at com.facebook.react.ReactInstanceManagerImpl.access$600(ReactInstanceManagerImpl.java:91)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:184)
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) 

@NeETsu NeETsu closed this as completed Dec 19, 2016
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants