Respond to native integration with an existing application crash: "Unable to find variable: __fbBatchedBridge"

I integrated the response to the native language with an existing application in the Android studio using the Facebook manuals: http://facebook.imtqy.com/react-native/docs/embedded-app-android.html#content

I found that the error "Unable to find a variable: __fbBatchedBridge" can be resolved by setting the dev menu. as ReferenceError: cannot find variable: __fbBatchedBridge

But my problem is that I showed the React Native page in the action of an existing application, it crashed when I started the action in response to my own view.

Error Log:

java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.facebook.react.bridge.JSExecutionException: ReferenceError: Can't find variable: __fbBatchedBridge (<unknown file>:1) at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:160) at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:779) 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:289) 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:841) Caused by: java.util.concurrent.ExecutionException: com.facebook.react.bridge.JSExecutionException: ReferenceError: Can't find variable: __fbBatchedBridge (<unknown file>:1) at com.facebook.react.common.futures.SimpleSettableFuture.get(SimpleSettableFuture.java:68) at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:136) at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:779) 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:289) 
+5
source share
2 answers

I had the same problem. It turns out how to react to v0.21 or so, the application will crash if your server is down (it previously showed a red error page, but was still running). Just start your server first:

 npm start 

then your application should work.

+2
source

Stop debugging Google Chrome. worked for me

0
source

Source: https://habr.com/ru/post/1244195/


All Articles