Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未找到react native的Android SDK_Android_React Native - Fatal编程技术网

未找到react native的Android SDK

未找到react native的Android SDK,android,react-native,Android,React Native,互联网上到处都有许多类似的问题,到目前为止还没有提供有效的解决方案。 我使用Android Studio 4.0.0,也许这就是问题所在 到目前为止,我在系统变量中获得了这些设置: 还有路径变量: 以下是react native info输出的内容: $ react-native info info Fetching system and libraries information... System: OS: Windows 10 10.0.18363 CPU: (6) x

互联网上到处都有许多类似的问题,到目前为止还没有提供有效的解决方案。
我使用Android Studio 4.0.0,也许这就是问题所在

到目前为止,我在系统变量中获得了这些设置:

还有路径变量:

以下是react native info输出的内容:

$ react-native info
info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.18363
    CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
    Memory: 23.08 GB / 31.86 GB
  Binaries:
    Node: 12.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Version  4.0.0.0 AI-193.6911.18.40.6514223
  Languages:
    Java: 11.0.2 - /c/Users/zarifov/AppData/Local/jdk-11.0.2/bin/javac
    Python: 2.7.18 - /c/Python27/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ~16.11.0 => 16.11.0
    react-native: ~0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found
此外,以防万一,请响应本地医生输出:

$ react-native doctor
Common
 ✓ Node.js
 ✓ yarn
 ✓ Python

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: N/A
   - Version supported: 28.0.3
 ✓ ANDROID_HOME

Errors:   1
Warnings: 0

Usage
 › Press f to try to fix issues.
 › Press e to try to fix errors.
 › Press w to try to fix warnings.
 › Press Enter to exit.
Common
 ✓ Node.js
 ✓ yarn
 ✓ Python

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: N/A
   - Version supported: 28.0.3
 ✓ ANDROID_HOME

Errors:   1
Warnings: 0

Usage
 › Press f to try to fix issues.
 › Press e to try to fix errors.
 › Press w to try to fix warnings.
 › Press Enter to exit.
其他重要信息:
通过doctor修复SDK问题的尝试无法成功,因为尽管PowerShell和IDE是以管理员权限启动的,但在尝试安装Androd命令行工具时由于“权限被拒绝”而失败。

您必须安装支持库,可以通过打开安卓Studio来完成此操作,SDK管理器和安装支持库版本28.0.3


我可以看到包裹死亡。它看起来像这样

我正好遇到了这个问题,并通过做一些简单的事情来解决它:

在'gradle wrapper.properties'文件中,我在
distributionUrl
值中更改了gradle的版本

这就像是
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
,我改为
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip


现在它开始工作了

你有没有尝试重新下载sdk?我刚下载了。就在你的建议之后。没用。我几乎可以肯定这是由于变量配置错误造成的。再次查看您的帖子,我在日志中看不到它在哪里找到sdk位置的URL,检查您是否实际分配了sdk位置Android_sdk_HOME我认为也应该指向sdk位置,但目前它指向C:/Users/zarifov,使其与ANDROID_HOME和ANDROID_SDK_Root相同实际上,SDK_HOME应该指向“默认”位置(用ANDROID术语),这是用户的配置文件。据安卓工作室自己说,一旦它连模拟器都不能启动,它就可以。是的-在我将其更改为用户配置文件之前,它被设置为相同的位置。构建工具的当前情况:可能你也需要安装SDK平台。SDK平台也已安装:继续并确保我的安装反映了你的配置,然后我又安装了一些,只是安装了所有的——两种情况都没有成功。