在配置喷射器之后进行react-native run-android

时间:2019-08-13 15:00:56

标签: react-native

失败:构建失败,并出现异常。

8秒内失败

错误无法安装该应用程序。确保已设置Android开发环境:https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment。使用--verbose标志运行CLI以获取更多详细信息。 错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort = 8081

失败:构建失败,并出现异常。

8秒内失败

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)

PS C:\ Users \ k7aled \ Desktop \ reactnative \ test2> npx react-native运行Android 信息运行jetifier将库迁移到AndroidX。您可以使用“ --no-jetifier”标志禁用它。 Jetifier发现有928个文件需要正向喷射。使用4名工人... 信息正在启动JS服务器... 信息正在安装应用程序...

失败:构建失败,并出现异常。

在10秒钟内失败

错误无法安装该应用程序。确保已设置Android开发环境:https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment。使用--verbose标志运行CLI以获取更多详细信息。 错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort = 8081

失败:构建失败,并出现异常。

在10秒钟内失败

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (C:\Users\k7aled\Desktop\reactnative\test2\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)

PS C:\ Users \ k7aled \ Desktop \ reactnative \ test2>

1 个答案:

答案 0 :(得分:0)

首先将这两行添加到您的android / gradle.properties中:

android.useAndroidX = true

android.enableJetifier = true

然后使用终端(cmd)在项目根目录中运行以下两个命令行:

npm我喷射器

npx jetify