【问题标题】:Error running adb: Error running app. Error: Activity not started, unable to resolve Intent运行 adb 时出错:运行应用程序时出错。错误:活动未启动,无法解析 Intent
【发布时间】:2017-08-28 15:47:40
【问题描述】:

您好,我正在尝试在我的 react-native 项目上运行“yarn android”。我遇到了以下错误:

yarn android v0.27.5
$ react-native-scripts android
10:37:45 AM: Starting packager...
10:39:34 AM: Starting Android...
10:39:37 AM: Packager started!

To view your app with live reloading, point the Expo app to this QR code.
You'll find the QR scanner on the Projects tab of the app.

    <QR CODE>                                                  

Or enter this address in the Expo app's search bar:

  exp://172.19.29.31:19000

Your phone will need to be on the same local network as this computer.
For links to install the Expo app, please visit https://expo.io.


    Logs from serving your app will appear here. Press Ctrl+C at any time to stop.

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

(node:28009) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'length' of null

我使用 create-react-native-app 生成器来设置我的应用程序,这是我的项目结构:

<username>$ls
App.js          app.json        gen         package.json
App.test.js     assets          my-app-key.keystore stylesheet.js
README.md       components      node_modules        yarn.lock 

我还尝试使用我的 expo 应用程序扫描 qr 码以在我的手机上运行我的应用程序,但它达到 100%,然后从应用程序中崩溃,或者它给出了深蓝色屏幕,其中错误是“未捕获的错误” “打包程序未在 http::19003 运行”(即使我扫描的端口是 http:19000)。

我刚刚也尝试运行“npm start”,然后为 android 选项运行“a”,但收到以下消息: 上午 11:40:20:启动 Android...

Error running adb: Error running app. Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=exp://172.19.29.31: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:31496) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'length' of null
11:43:30 AM: Running app on SM-T560NU in development mode

11:44:01 AM: [sane] Warning: Lost connection to watchman, reconnecting..

谁能帮我解决这个问题?

【问题讨论】:

  • 你能理解这个错误是什么意思“Cannot read property 'length' of null”吗?对我来说似乎是一个 JS 代码。不确定。

标签: android react-native expo create-react-native-app


【解决方案1】:

尝试删除apk

rm -rf ~/.expo/android-apk-cache

来源:https://www.bountysource.com/issues/43329081-error-staring-android-emulator

【讨论】:

    【解决方案2】:

    确保您在模拟器上使用最少的 API 19,它以某种方式对我有用。

    【讨论】:

      【解决方案3】:

      您可能需要重新安装安卓应用,您可以使用expo install:android 重新安装,然后尝试再次打开它

      【讨论】:

        【解决方案4】:

        规格:

        • Macbook pro 14、M1、16GB、512GB
        • npm 版本 8.1.2
        • 世博会 5.0.3 版

        它可能对你有用,但我有一个解决方案,这就是为什么将它作为答案发布。

        您可以做的事情是,只需清除在模拟器任务中运行的应用程序,包括 Expo Go App,然后打开 Expo Go App,从中清除您的应用程序,然后尝试使用这些命令再次运行它npm start 或 @987654322 @ 或npm run ios

        我希望它也对你有用。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-02-12
          • 2021-12-06
          • 2021-06-27
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多