当前位置: 首页 > 知识库问答 >
问题:

React Native |安装应用程序失败。请使用SDK管理器接受所有必要的SDK许可证

郗福
2023-03-14

我试图开始运行我的反应原生项目。但是我在运行反应原生运行Android命令时遇到了这个错误。我尝试了一系列我在网上找到的解决方案,但都不起作用。


info Starting JS server...
info Installing the app...

> Configure project :app
Checking the license for package Android SDK Build-Tools 28.0.3 in /home/dipanshuchaubey/Android/Sdk/licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in /home/dipanshuchaubey/Android/Sdk/licenses
Warning: License for package Android SDK Platform 28 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /home/dipanshuchaubey/Android/Sdk

* 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 3s

error Failed to install the app. Please accept all necessary SDK licenses using SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses". Run CLI with --verbose flag for more details.
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 install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /home/dipanshuchaubey/Android/Sdk

* 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

3s内构建失败

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (/home/dipanshuchaubey/Documents/practice/native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/home/dipanshuchaubey/Documents/practice/native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:137:41)
at /home/dipanshuchaubey/Documents/practice/native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:103:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (/home/dipanshuchaubey/Documents/practice/native/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:160:7)

如何解决这个问题。

提前感谢:)

共有3个答案

邴兴为
2023-03-14

如果你正在使用ubuntu,请这样做:--

1.

2.

师博
2023-03-14

对于linux用户:

  1. 导航到路径:: cd~/库/Android/sdk/工具/bin/或路径的Android

并接受您尚未接受(但需要)的许可证。

有关更多详细信息,请参阅Android Studio留档

须敏学
2023-03-14

转到配置

选择SDK工具选项卡并安装Google Play授权库

 类似资料:
  • 第一次在Windows上设置React Native开发环境,我创建了一个新的React Native项目,将cd放入其中,然后运行。我收到错误信息: 正在启动JS服务器。。。系统找不到指定的路径。信息启动模拟器。。。错误:无法启动emulator。原因:未找到作为输出的模拟器。警告:请手动启动模拟器或连接设备。否则应用程序可能无法启动。 错误安装应用程序失败。请使用Android SDK管理器接

  • 经过一些 <罢工> 向万物祈祷 google搜索发现shell脚本安装在一个不相关的位置,必须运行该脚本才能接受许可证。克服了最初的 <罢工> 信仰的考验 问题,我运行脚本并遇到以下错误。 我在网上发现了许多有同样问题的人。 从这个问题来看,最流行的解决方案建议在shell脚本中找到特定的一行,并添加。这将导致以下错误。 null 有没有人知道一种不那么复杂的方法,可以在2019年用Java11首

  • 我正在为一个android应用程序建立一个新的Jenkins版本来运行测试。我已经在AWS实例上下载了android工具。然后运行以下命令安装其他软件包以安装平台和构建工具。 <代码>/android update sdk--无ui--filter build-tools-28.0.3、android-28、extra-android-m2repository/android update sdk

  • 我在接受Android SDK构建工具28.0.3的许可时遇到了问题。在Gitlab上运行时会出现。

  • 已接受所有许可证。我怎么解决这个? 解决方案:删除,然后通过Android Studio的SDK管理器重新安装所有SDK。