android - 无法使用模拟器,使用 react-native 和 expo

标签 android react-native expo

我在 expo 中使用 React Native,操作系统:Elementary OS,模拟器:Android Studio 模拟器。

尝试在模拟器中打开应用程序时出现以下错误

12:58:16: Starting Android...
Error running adb: Error running app. Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=exp://192.168.0.101:19000 flg=0x10000000 }


 › Press a to open Android device or emulator, or i to open iOS emulator.
 › Press q to display QR code.
 › Press r to restart packager, or R to restart packager and clear cache.
 › Press d to toggle development mode. (current mode: development)

(node:15266) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of null
    at /xdl/src/Android.js:90:18
    at Generator.next (<anonymous>)
    at step (/home/afzal/AFZAL/Cloud_Drive/Development/React Native/react-native-boilerplate-redux-flow-master/node_modules/xdl/build/Android.js:475:191)
    at /home/afzal/AFZAL/Cloud_Drive/Development/React Native/react-native-boilerplate-redux-flow-master/node_modules/xdl/build/Android.js:475:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:15266) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

最佳答案

下载expo的XDE并从XDE创建项目

https://github.com/expo/xde/releases

在你的电脑和手机上通过相同的wifi连接运行应用程序或者你可以用数据线连接

对于 Emulator,首先启动 Emulator,然后运行应用程序 你可以为模拟器使用 genymotion

关于android - 无法使用模拟器,使用 react-native 和 expo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49189149/

相关文章:

android - 我怎样才能获得默认短信应用程序的包名?

java - 如何解决问题: "java.lang.RuntimeException: For ExpandableListView, use setAdapter(ExpandableListAdapter) instead of setAdapter(ListAdapter)"

android - 为什么使用ndk-build构建ffmpeg时会出错?

android - AVG 杀毒软件将我的 React Native Android 应用程序检测为恶意软件

android - react 本地android list 合并失败

javascript - 在 View 组件中使用字符串变量导致 "Unexpected text node"

javascript - 如何查看苹果收据的有效期?

javascript - TypeError - 网络请求失败(没有提示问题出在哪里)

android - 单击事件不适用于 android 中的线性布局

javascript - 有没有办法在 react-native 新 Assets 系统中要求非图像 Assets ?