在Expo Eject之后,运行Android错误:spawnSync gradlew.bat Enoent

时间:2019-07-11 03:25:17

标签: android react-native expo

我当时正在使用expo,但是随后需要链接第三方程序包,因此我使用Expo Kit从expo中退出。现在,当我尝试react-native run-android时,都会启动Metro bundler,但是会发生以下错误:

info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error spawnSync gradlew.bat ENOENT
debug Error: spawnSync gradlew.bat ENOENT
    at Object.spawnSync (internal/child_process.js:981:20)
    at spawnSync (child_process.js:585:24)
    at execFileSync (child_process.js:613:13)
    at runOnAllDevices (C:\Users\Mahmoud's Laptop\RN\ikraawarka\node_modules\@react-native-community\cli\build\commands\runAndroid\runOnAllDevices.js:58:39)
    at buildAndRun (C:\Users\Mahmoud's Laptop\RN\ikraawarka\node_modules\@react-native-community\cli\build\commands\runAndroid\runAndroid.js:142:41)
    at then.result (C:\Users\Mahmoud's Laptop\RN\ikraawarka\node_modules\@react-native-community\cli\build\commands\runAndroid\runAndroid.js:104:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)

更多信息: react-native-cli: 2.0.1 react-native: 0.59.8 expo: 2.20.2

我仍然能够运行expo start,它可以在expo客户端应用程序中运行。谢谢

2 个答案:

答案 0 :(得分:1)

如果您只是在项目目录上expo start弹出expo工具包,然后在Android Studio或XCode中运行该项目。

答案 1 :(得分:0)

也许您遇到的问题与我相同,没有找到setUser({})。 我不知道什么时候消失了... 要解决它,您可以从另一个项目复制此文件。