尝试在Android 4.4.2上创建一个反应原生项目,我得到了这个错误屏幕
却找不到解决的办法。我尝试重新启动packager,重新连接设备,甚至重新安装react native并开始新的项目。在6.0.0和更高版本上,它工作得很好。
尝试在Android 4.4.2上创建一个反应原生项目,我得到了这个错误屏幕
却找不到解决的办法。我尝试重新启动packager,重新连接设备,甚至重新安装react native并开始新的项目。在6.0.0和更高版本上,它工作得很好。
当前回答
我也遇到了同样的问题,但这是我自己犯的一个愚蠢的错误……
从Android工作室,我从应用程序项目而不是根项目启动installDebug/installRelease gradle脚本。
其他回答
看到的问题:
1.react-native开始
2.单击设备上的“重新加载(R,R)”。
在我的情况下,它是jsEngine: 'hermes'下的android分段,删除它固定的生产构建。
我也得到了这个错误,真的很困惑。因为不是所有的答案都有效。 就在添加adb到路径之后。
因为你使用的是Android < 5.0,所以你不能使用默认的adb反向方法,但是Facebook已经添加了官方文档来通过Wi-Fi连接到开发服务器,这将支持你的版本。引用MacOS的说明,但也有Linux和Windows的说明:
Method 2: Connect via Wi-Fi You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable, but once that has been done you can debug wirelessly by following these instructions. You'll need your development machine's current IP address before proceeding. You can find the IP address in System Preferences → Network. Make sure your laptop and your phone are on the same Wi-Fi network. Open your React Native app on your device. You'll see a red screen with an error. This is OK. The following steps will fix that. Open the in-app Developer menu. Go to Dev Settings → Debug server host for device. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). Go back to the Developer menu and select Reload JS.
虽然有点晚,但这对我来说真的很管用。
react-native运行android。 react-native开始。
第一个命令将为android构建apk,并将其部署到连接的设备上。当你打开应用程序,它会显示红色屏幕错误。然后运行第二个命令,该命令将运行packager并为您构建应用程序包。