当我键入命令 npx react-native run-android 时,我收到 1 个错误和 1 个警告,并且警告显示在 vscode 的终端窗口旁边。
+ 文件名的颜色变为绿色,并显示一个 U 标记。
我以为我只需要安装 Android Studio 模拟器。
PS C:\Users\gogum\OneDrive\바탕 화면\nomadreact\AwesomeProject> npx react-native run-android
info Starting JS server...
��d�� ��θ� ã; �� ��4ϴ�.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'AwesomeProject'.
> Could not open cp_proj generic class cache for build file 'C:\Users\gogum\OneDrive\���� ȭ��\nomadreact\AwesomeProject\android\build.gradle' (C:\Users\gogum\.gradle\caches\7.5.1\scripts\a5ygbdadaeeg0rkha3nsmbkg1).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 44s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'AwesomeProject'.
> Could not open cp_proj generic class cache for build file 'C:\Users\gogum\OneDrive\���� ȭ��\nomadreact\AwesomeProject\android\build.gradle' (C:\Users\gogum\.gradle\caches\7.5.1\scripts\a5ygbdadaeeg0rkha3nsmbkg1).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 44s
at makeError (C:\Users\gogum\OneDrive\바탕 화면\nomadreact\AwesomeProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\gogum\OneDrive\바탕 화면\nomadreact\AwesomeProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\gogum\OneDrive\바탕 화면\nomadreact\AwesomeProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (C:\Users\gogum\OneDrive\바탕 화면\nomadreact\AwesomeProject\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.
试过:
Android Studio 的虚拟设备管理器
=> 我在 android studio 中打开了虚拟设备管理器并创建了 Nexus 5X API 33 (tiramisu)。
但是错误还是出现了。我应该怎么办?帮助!