reactnativecn / react-native-website

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

按照官方文档搭建开发环境,编译应用的时候一直报错 #838

Closed YiwenOne closed 3 weeks ago

YiwenOne commented 6 months ago

问题的具体描述

BUILD FAILED in 2s error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. What went wrong: A problem occurred configuring root project 'AwesomeProject'. > Could not determine the dependencies of null. > Could not resolve all dependencies for configuration ':classpath'. > The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility 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 2s. 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.

sunnylqm commented 6 months ago

jdk版本不对

wh-hujinyun commented 5 months ago

请问最后解决了吗?

hdjhdjhdj commented 4 months ago

最后怎么解决了啊

Jidahan commented 4 months ago

我也是一样的问题

sunnylqm commented 4 months ago

JDK版本不对,就对着文档弄成文档需要的JDK版本

Jidahan commented 4 months ago

我也是一样的问题

目前已经解决,使用android studio打开项目,等他自己安装,爆红后点击控制台左边得刷新按钮【reload gradle project】失败了再多点几次,然后就好了

Jidahan commented 4 months ago

我也是一样的问题

目前已经解决,使用android studio打开项目,等他自己安装,爆红后点击控制台左边得刷新按钮【reload gradle project】失败了再多点几次,然后就好了

微信截图_20240726144013

hdjhdjhdj commented 4 months ago

我也是一样的问题

目前已经解决,使用android studio打开项目,等他自己安装,爆红后点击控制台左边得刷新按钮【reload gradle project】失败了再多点几次,然后就好了

微信截图_20240726144013

感谢,我解决了。 原来我用官方文档,直接cmd命令npx react-native run-android打开,可能代理不稳定,容易超时,导致出错 直接用android studio打开项目,这边超时可以重新再安装,会好一点,多重试几次。我装了2个多小时才装好

github-actions[bot] commented 1 month ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 weeks ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.