无法在 EMULATOR 上安装应用程序并启动它 - React Native
Unable to install app on EMULATOR and to launch it - React Native
拜托,我是 reactNative 的初学者,我尝试使用模拟器和命令 react-native 运行-android 创建一个应用程序,这就是消失的原因。请帮帮我
描述:
info 运行ning jetifier 将库迁移到 AndroidX。您可以使用“--no-jetifier”标志禁用它。
Jetifier 找到 864 个文件以转发 Jetify。使用4名工人...
信息正在启动 JS 服务器...
* 守护进程不是 运行ning;现在开始 tcp:5037
* 守护进程启动成功
信息正在安装应用程序...
启动一个 Gradle 守护进程,1 个不兼容和 3 个停止的守护进程无法重复使用,使用 --status 获取详细信息
Task :app:transformClassesWithDexBuilderForDebug FAILED
此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 6.0 不兼容。
使用“--warning-mode all”来显示各个弃用警告。
参见 https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
17 个可操作任务:8 个已执行,9 个已更新
失败:构建失败,出现异常。
出了什么问题:
任务“:app:transformClassesWithDexBuilderForDebug”执行失败。
Could not read path 'C:\Users\ruthel BAC\Desktop\firstAppReact\android\app\build\intermediates\transforms\dexBuilder\debug\androidx\customview'.
尝试:
运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。 运行 使用 --scan 以获得完整的见解。
获取更多帮助
1 分钟 39 秒后构建失败
error 应用安装失败。确保您已设置 Android 开发环境:https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment。 运行命令行界面
使用 --verbose 标志以获取更多详细信息。
错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
失败:构建失败,出现异常。
出了什么问题:
任务“:app:transformClassesWithDexBuilderForDebug”执行失败。
Could not read path 'C:\Users\ruthel BAC\Desktop\firstAppReact\android\app\build\intermediates\transforms\dexBuilder\debug\androidx\customview'.
尝试:
运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。 运行 使用 --scan 以获得完整的见解。
获取更多帮助
1 分钟 39 秒后构建失败
at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:13)
at runOnAllDevices (C:\Users\ruthel BAC\Desktop\firstAppReact\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\ruthel BAC\Desktop\firstAppReact\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at then.result (C:\Users\ruthel BAC\Desktop\firstAppReact\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
npm 错误!代码生命周期
错误!错误号 1
错误! firstAppReact@0.0.1 android: react-native run-android
错误!退出状态 1
错误!
错误!在 firstAppReact@0.0.1 android 脚本处失败。
错误!这可能不是 npm 的问题。上面可能有额外的日志输出。
npm 错误!此 运行 的完整日志可在以下位置找到:
错误! C:\nodejs\npm-cache_logs20-02-28T09_11_15_219Z-debug.log
- 取消进程
- 打开新终端
- 在您的项目目录中,运行
cd android
--> .\gradlew clean
- 完成后,
cd..
这样就可以直接进入工程文件了
- 运行
react-native-start
- 等待终端显示:
Looking for dependency, done
- 然后打开第二个终端,直接进入你的项目和运行
react-native run-android
(或者ios,如果你使用Xcode)
我 运行 之前遇到过这个问题,所以试试这个。希望对你有所帮助
拜托,我是 reactNative 的初学者,我尝试使用模拟器和命令 react-native 运行-android 创建一个应用程序,这就是消失的原因。请帮帮我
描述:
info 运行ning jetifier 将库迁移到 AndroidX。您可以使用“--no-jetifier”标志禁用它。 Jetifier 找到 864 个文件以转发 Jetify。使用4名工人... 信息正在启动 JS 服务器... * 守护进程不是 运行ning;现在开始 tcp:5037 * 守护进程启动成功 信息正在安装应用程序... 启动一个 Gradle 守护进程,1 个不兼容和 3 个停止的守护进程无法重复使用,使用 --status 获取详细信息
Task :app:transformClassesWithDexBuilderForDebug FAILED
此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 6.0 不兼容。 使用“--warning-mode all”来显示各个弃用警告。 参见 https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 17 个可操作任务:8 个已执行,9 个已更新
失败:构建失败,出现异常。
出了什么问题: 任务“:app:transformClassesWithDexBuilderForDebug”执行失败。
Could not read path 'C:\Users\ruthel BAC\Desktop\firstAppReact\android\app\build\intermediates\transforms\dexBuilder\debug\androidx\customview'.
尝试: 运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。 运行 使用 --scan 以获得完整的见解。
- 获取更多帮助
1 分钟 39 秒后构建失败
error 应用安装失败。确保您已设置 Android 开发环境:https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment。 运行命令行界面 使用 --verbose 标志以获取更多详细信息。 错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
失败:构建失败,出现异常。
出了什么问题: 任务“:app:transformClassesWithDexBuilderForDebug”执行失败。
Could not read path 'C:\Users\ruthel BAC\Desktop\firstAppReact\android\app\build\intermediates\transforms\dexBuilder\debug\androidx\customview'.
尝试: 运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。 运行 使用 --scan 以获得完整的见解。
- 获取更多帮助
1 分钟 39 秒后构建失败
at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:13)
at runOnAllDevices (C:\Users\ruthel BAC\Desktop\firstAppReact\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\ruthel BAC\Desktop\firstAppReact\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at then.result (C:\Users\ruthel BAC\Desktop\firstAppReact\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
npm 错误!代码生命周期
错误!错误号 1
错误! firstAppReact@0.0.1 android: react-native run-android
错误!退出状态 1
错误!
错误!在 firstAppReact@0.0.1 android 脚本处失败。
错误!这可能不是 npm 的问题。上面可能有额外的日志输出。
npm 错误!此 运行 的完整日志可在以下位置找到: 错误! C:\nodejs\npm-cache_logs20-02-28T09_11_15_219Z-debug.log
- 取消进程
- 打开新终端
- 在您的项目目录中,运行
cd android
-->.\gradlew clean
- 完成后,
cd..
这样就可以直接进入工程文件了 - 运行
react-native-start
- 等待终端显示:
Looking for dependency, done
- 然后打开第二个终端,直接进入你的项目和运行
react-native run-android
(或者ios,如果你使用Xcode) 我 运行 之前遇到过这个问题,所以试试这个。希望对你有所帮助