React Native Android debug build crashes on launch, iOS works fine - react-native

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.

- 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.
Expo:
https://github.com/expo/expo/blob/sdk-33/android/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java
React-native:
https://github.com/facebook/react-native/blob/0.60-stable/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java
Solution:
Remove the Facebook folder from "/home/$user/.m2/repository/com/facebook" then sync the project again to re-download the correct library.

Related

Ejected Expo, React Native, can't find libreactnativejni.so

I've got an Ejected Expo project, that's getting the following error while trying to run on Android.
I'm aware there's lots of documentation on this issue but all seem focused on 64bit binaries being included. I've unzipped the APK that's generated and the lib folder only contains :
/x86
/armeabi-v7a
So if there is a 64Bit include, I cant see where it would be?
Any suggestions?
2019-06-02 17:32:27.725 6202-6280/com.projectName.dynamic E/SoLoader: couldn't find DSO to load: libreactnativejni.so
2019-06-02 17:32:27.727 6202-6280/com.projectName.dynamic E/AndroidRuntime: FATAL EXCEPTION: Thread-3
Process: com.projectName.dynamic, PID: 6202
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:703)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:564)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:500)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:455)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:18)
at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:19)
at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create(JSCJavaScriptExecutorFactory.java:21)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:914)
at java.lang.Thread.run(Thread.java:764)

Unable to run react-native app on android device - installDebug error

I am trying to run my react-native app on my android device via cable with USB debugging enabled in developer mode. The android version is 5.1 (Lolipop). I keep on getting this error, please suggest how
Unable to install E:\react-native\AwesomeProject\android\app\build\outputs\apk\app-debug.apk
com.android.ddmlib.InstallException: Failed to install all
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:89)
at com.android.ddmlib.Device.installPackages(Device.java:904)
at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137)
at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute (AnnotationProcessingTaskFactory.java:228)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute (AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute (AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
12:43:11 E/1258563779: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])
:app:installDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 43.72 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
I don't want to use the android emulator, instead, i want to test the app on my physical device.
I have already installed required stuff as per the react-native getting started documentation. Still, I keep on getting the same error.
Thanks in advance
I have suffered from this prolem before, it cause by MIUI Optimization of my device. Since you are not running on Mi device so you may have 2 ways to solve this.
Work around solution: com.android.tools.build:gradle to 2.3.0 and gradle plugins to version 3.3.
Restart adb:
You had to type:
adb kill-server
adb connect 192.168.0.14:5555
Wait a moment then run:
adb devices
This will show you the DEVICE_ID of your device running android. It is usually its IP address followed by the port 5555 (usually, not always).
react-native run-android --deviceId DEVICE_ID
The important part was the --deviceId DEVICE_ID. Without this, the apk would never get uploaded to the phone.
Then, IF the app launched with a red screen... You had to shake it, go to "dev settings", adjust the "debug server host & port for device", putting your computer's IP address and port, like this:
192.168.0.15:8081
Many people have same issues: See this and this
I also had the same issue and my issue was difference in Android version of my device and Android SDK version at my computer.
Android version for my device was Android 6 and my Android Studio was configured to build for Android 9.
How to solve?
Upgrade your Android version of the device to 9 or simply install SDK for Android 6 in your computer.
Install Android 6 SDK in computer -
Open Android Studio
Configuration -> SDK manager
Tick Android 6 and click the button Apply
After finishing the installation, try to rebuild the application using react-native run-android
Hope it will help someone.

React Native Android - "Could not get BatchedBridge, make sure your bundle is packaged properly"

Running on Android - I can no longer get my app to build. I've tried 15+ ideas on stack overflow with similar batchedbridge errors'.
Results - after packaging:
- Red error screen popups up with "Could not get BatchedBridge, make sure your bundle is packaged properly” (with no other callstack details) and then a second later get a blank white screen.
Results - after the error and then reloading from the app dev tools menu:
- Could not connect to development server
react-native version 0.40.0 npm=5.0.3 node=v7.4.0
The app was working previously for months so i'm guessing connected to a recent change, version problem, cache problem, npm version or reactnative version?
Tried adb reverse tcp:8081 tcp:8081
Tried npm cache clean
Tried on emulator and device - same issue
Tried closing all react packagers
Made sure no other react native apps/packagers running
Android app is building OK in Android Studio (without react native)
Looking in the logcat I seem some red flags but not sure if these problems are new or were previously there:
- Lots of 'ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.???????' etc
- React: The packager does not seem to be running as we got an IOException requesting its status: Connection reset
Here's the logcat snippet and stack trace from the app when it tries to start - if you need more of the logcat let me know (my attempt to add it here didn't work).
iceapp.challengeme ic=null D/FA: Connected to remote service W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.reactnative.androidsdk.FBLoginButtonManager V/FA: Processing queued up service tasks: 2 W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.reactnative.androidsdk.FBSendButtonManager W/art: Before Android 4.1, method boolean com.facebook.share.widget.ShareButtonBase.canShare() would have incorrectly overridden the package-private method in android.widget.TextView W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.reactnative.androidsdk.FBShareButtonManager
E/unknown:React: Exception in native call from JS
com.facebook.react.devsupport.JSException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:762)
Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
at android.os.Handler.handleCallback(Handler.java:751) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
at android.os.Looper.loop(Looper.java:154) 
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) 
at java.lang.Thread.run(Thread.java:762)  W/unknown:React: Packager connection already open, nooping. W/unknown:React: Inspector connection already open, nooping. E/unknown:React: Exception in native call
java.lang.RuntimeException: Error calling function: RCTDeviceEventEmitter:emit
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.RuntimeException: Empty Optional cannot be unwrapped
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
at android.os.Handler.handleCallback(Handler.java:751) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
at android.os.Looper.loop(Looper.java:154) 
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) 
at java.lang.Thread.run(Thread.java:762)  E/unknown:React: Exception in native call
java.lang.RuntimeException: Error calling function: AppRegistry:runApplication
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.RuntimeException: Empty Optional cannot be unwrapped
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
at android.os.Handler.handleCallback(Handler.java:751) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
at android.os.Looper.loop(Looper.java:154) 
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) 
at java.lang.Thread.run(Thread.java:762) 

React-Native: _reactNativeFacebookLogin.FBLoginManager.loginWithPermissions is undefined

Im trying to implement this Facebook-SDK for React-Native.
I followed the steps in the README guide but cannot get it to Work.
Every time i try to log in with Facebook I get the following error message:
EDIT: Im running the a signed APK
EDIT2: The error does only happen with the signed APK - what could that mean?
undefined is not a function (evaluating '_reactNativeFacebookLogin.FBLoginManager.loginWithPermissions')
Unable to symbolicate stack trace: Bundle was not loaded from the packager
FATAL EXCEPTION: mqt_native_modules
Process: com.solopro.dogwood, PID: 5018
com.facebook.react.modules.core.JavascriptException: undefined is not a function (evaluating '_reactNativeFacebookLogin.FBLoginManager.loginWithPermi
ssions'), stack:
facebookLogin#76454:62
touchableHandlePress#52180:39
_performSideEffectsForTransition#21343:26
_receiveSignal#21259:38
touchableHandleResponderRelease#21033:20
invokeGuardedCallback#15044:12
executeDispatch#14877:38
executeDispatchesInOrder#14900:16
executeDispatchesAndRelease#14354:42
executeDispatchesAndReleaseTopLevel#14365:35
forEachAccumulated#15179:12
processEventQueue#14527:19
runEventQueueInBatch#15204:33
handleTopLevel#15215:21
<unknown>#14147:39
perform#16143:16
batchedUpdates#31745:20
batchedUpdates#15373:32
_receiveRootNodeIDEvent#14146:28
receiveTouches#14208:48
__callFunction#7706:28
<unknown>#7613:22
guard#7564:3
callFunctionReturnFlushedQueue#7612:6
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:90)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:78)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:187)
at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:62)
at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:432)
at com.facebook.react.bridge.queue.NativeRunnableDeprecated.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:135)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:193)
at java.lang.Thread.run(Thread.java:818)
Maybe this is even a known issue.
UPDATE:
The error is pointing out the function "loginWithPermissions" which is not even available in the android package of react-native-fbsdk but only in the iOS package.
I have no idea why this function is being used.
I am using LoginManager.logInWithReadPermissions(['public_profile', 'email']).then(...) for the FB-Login
Most likely the questioner had overcome this issue.
Sometimes, if some Facebook libraries (like fbjs/lib/invariant) are used in development process, the related lines must be marked as comment line before building the release apk.

java.lang.IllegalAccessError on launch of react native activity in release mode

I have added one React Native screen to my existing android project.
Copying the proguard settings related to react native from
https://github.com/facebook/react-native/blob/master/local-cli/generator-android/templates/src/app/proguard-rules.pro WORKS.
However I want to enable obfuscation for my project and hence commented out the line -dontobfuscate
After this, when I deploy the release build in my nexus device, I get this error :
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
Process: com.sampleapp, PID: 2463
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.<init>()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule' (declaration of 'com.facebook.react.modules.netinfo.NetInfoModule' appears in /data/app/com.sampleapp-1/base.apk)
at com.facebook.react.modules.netinfo.NetInfoModule.<init>(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$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:5091)
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)
This link does mention obfuscation isn't supported in React-Native:
https://github.com/facebook/react-native/issues/7530
I want to obfuscate existing app code.