reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
219 stars 328 forks source link

yarn react-native run-android 报error #895

Open WhutZml opened 3 weeks ago

WhutZml commented 3 weeks ago

请按以下格式提供问题的相关信息。

问题的具体描述

BUILD FAILED in 52s error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. Where: Settings file 'D:\Android\GitPro\cloud_edge\node_modules\@react-native\gradle-plugin\settings .gradle.kts' line: 16 What went wrong: Plugin [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.5.0'] was not foun d in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Included Builds (No included build s contain this plugin) - Plugin Repositories (could not resolve plugin artifact 'org.gradle.toolchains.foojay-resolver-convention:org.g radle.toolchains.foojay-resolver-convention.gradle.plugin:0.5.0') Searched in the following repositories: MavenRepo Google Gradle Centr al Plugin Repository * 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 52s. info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 屏幕截图 2024-10-26 002509

请描述完整的环境/版本信息

System: OS: Windows 11 10.0.22631 CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H Memory: 3.42 GB / 15.81 GB Binaries: Node: version: 20.17.0 path: D:\NodeJs\node.EXE Yarn: version: 1.22.22 path: ~\AppData\Roaming\npm\yarn.CMD npm: version: 10.8.2 path: D:\NodeJs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio:

package.json

{ "name": "frontend", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "react": "18.2.0", "react-native": "0.74.5" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.74.87", "@react-native/eslint-config": "0.74.87", "@react-native/metro-config": "0.74.87", "@react-native/typescript-config": "0.74.87", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" } }

预期结果

xiangjiu0918 commented 3 weeks ago

请问解决了吗?我也遇到了这个问题