reactnativecn / react-native-website

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

Could not resolve com.facebook.react:react-android:0.71.3. #695

Closed noecs closed 1 year ago

noecs commented 1 year ago

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

问题的具体描述

我在使用npx react-native init AwesomeProject命令,创建了一个新项目,当我执行npx react-native run-android命令时,报错找不到包。详细报错如下:

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.facebook.react:react-android:0.71.3.
     Required by:
         project :app
      > Could not resolve com.facebook.react:react-android:0.71.3.
         > Could not get resource 'https://oss.sonatype.org/content/repositories/snapshots/com/facebook/react/react-android/0.71.3/react-android-0.71.3.pom'.
            > Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/com/facebook/react/react-android/0.71.3/react-android-0.71.3.pom'.
               > oss.sonatype.org:443 failed to respond
...

我确信我的梯子正常,命令行执行curl www.google.com无误,我尝试打开报错中的url地址,均为404。其次也去看了rn官方的issue,请教怎么解决这个问题。

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

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Memory: 82.22 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.5.0 - /var/folders/vp/cswkkb455qjgw7cdfb50fkw40000gn/T/yarn--1676628162618-0.24320519501425286/node
    Yarn: 1.22.19 - /var/folders/vp/cswkkb455qjgw7cdfb50fkw40000gn/T/yarn--1676628162618-0.24320519501425286/yarn
    npm: 9.3.1 - /opt/homebrew/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK: Not Found
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.5 - /usr/local/graalvm-ce-java17-22.3.0/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.3 => 0.71.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
✨  Done in 2.24s.

预期结果

应当能够正常运行至安卓真机上。

github-actions[bot] commented 1 year 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 1 year 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.