如何解决Linux 上 Pycharm 专业版中的 React-Native Android 和 iOS 模拟器
我正在尝试在 Pycharm(在 Linux 上)中运行 React-native 应用程序,但我不明白如何安装 Android 和 iOS 模拟器。我试图按照教程 here 进行操作,但显然它失败了。当我尝试在 Android react-native run-android
上启动时,出现以下错误:
react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
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...
Deprecated Gradle features were used in this build,making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/media/dev/test/android/local.properties'.
* 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 1s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
同样,当我尝试使用 iOS 时,我收到此错误:
error Could not find "Podfile.lock" at /media/dev/test/ios/Podfile.lock. Did you run "pod install" in iOS directory?
info Found Xcode project "reactNative_tests.xcodeproj"
error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Run CLI with --verbose flag for more details.
Error: spawnSync xcrun ENOENT
at Object.spawnSync (internal/child_process.js:1067:20)
所以我的问题很简单:如何在 Pycharm 中安装这些模拟器?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。