【问题标题】:Unable to work with emulator, using react-native and expo无法使用模拟器,使用 react-native 和 expo
【发布时间】:2018-08-17 18:04:28
【问题描述】:

我在 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)

【问题讨论】:

    标签: android react-native expo


    【解决方案1】:

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

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

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

    对于模拟器,首先启动模拟器,然后运行应用程序 您可以将 genymotion 用于模拟器

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-26
      • 2019-08-07
      • 1970-01-01
      • 2023-02-02
      • 2021-11-28
      • 1970-01-01
      相关资源
      最近更新 更多