简体   繁体   English

React-native基本项目给出错误:_JS调用:_fbBatchedBridge未定义

[英]React-native basic project gives error: _JS call: _fbBatchedBridge is undefined

I am currently trying to run a redux/react-native project. 我目前正在尝试运行一个redux / react-native项目。 Currently I just have a basic application with one screen that should display the text "test" but I get this weird error on ios that is 目前,我只有一个基本应用程序,其中一个屏幕应显示文本“ test”,但在ios上却收到此奇怪的错误,即

"Unable to execute JS call: _fbBatchedBridge is undefined"

I then tried to install the application on android through react-native run-android and it says that the developer server isn't up. 然后,我尝试通过react-native run-android将应用程序安装在android上,它说开发人员服务器没有启动。 I checked localhost:8081/status and it does show that the developer server is running. 我检查了localhost:8081 / status,它确实表明开发人员服务器正在运行。

What I have tried 我尝试过的

I have tried a bunch of different things. 我尝试了很多不同的事情。 It's definitely not the developer server. 绝对不是开发人员服务器。 I tried commenting out 4 lines of code in the file in /node_modules/react-native/packager/react-native-xcode.sh which were lines 17-20. 我尝试注释掉/node_modules/react-native/packager/react-native-xcode.sh中文件的4行代码,即17-20行。

  #if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then
    #  echo "Skipping bundling for Simulator platform"
    #  exit 0;
    #fi

This was causing a bunch of people that same issue. 这引起了很多人同样的问题。 Unfortunately that didn't fix my problem so I kept reading and from what I read it could be that the native aspect of the application isn't able to read and interpret the javascript. 不幸的是,这并不能解决我的问题,所以我一直在阅读,从我的阅读中可能是应用程序的本机方面无法读取和解释javascript。 Any help would be much appreciated. 任何帮助将非常感激。

My index.ios.js file (entry) looks like this: 我的index.ios.js文件(条目)如下所示:

import React from 'react-native';

var React = require('react-native');

const {
  AppRegistry
} = React;

import App from './app/containers/app';

AppRegistry.registerComponent('InstallApp', () => App);

This generally happens when the connection is not made between react-native and android device automatically , for explicitly making the connection you can run 当未在react-native和android设备之间自动建立连接时,通常会发生这种情况,为了显式建立连接,您可以运行

adb reverse tcp:8081 tcp:8081

provided you have not modified port in any of the system files for rn. 前提是您尚未在rn的任何系统文件中修改端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM