如何解决React-native 错误:命令失败:./gradlew app:installDebug -PreactNativeDevServerPort = 8081
使用 React Native,我想在 Genymotion 模拟器上运行一个简单的应用程序。但是我在每个示例中都遇到相同的错误。我已经阅读了 Stackoverflow 资源并尝试了它,但它没有发生。有没有办法做到这一点?我删除了gradle文件并重新安装并再次检查了android sdks。
Cansu-Air:react-native-login-master Cans$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 903 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
BUILD FAILED
Total time: 9.085 secs
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find target with hash string 'android-23' in: /Users/Cans/Library/Android/sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
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 app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find target with hash string 'android-23' in: /Users/Cans/Library/Android/sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at makeError (/Users/Cans/Desktop/react-native-login-master/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /Users/Cans/Desktop/react-native-login-master/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (/Users/Cans/Desktop/react-native-login-master/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/Users/Cans/Desktop/react-native-login-master/node_modules/@react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。