反应本机|无法安装该应用程序.请使用SDK Manager接受所有必要的SDK许可 [英] React Native | Failed to install the app. Please accept all necessary SDK licenses using SDK Manager

查看:513
本文介绍了反应本机|无法安装该应用程序.请使用SDK Manager接受所有必要的SDK许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图开始运行我的React Native项目.但是在运行react-native run-android命令时出现此错误.我尝试了很多在网上找到的解决方案,但都没有用.

I was trying to start running my react native project. But I'm getting this error while running the react-native run-android command. I tried a bunch of solutions that I found online but neither of them worked.


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

3秒内失败

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)

如何解决此问题.

预先感谢您:)

推荐答案

转到Android Studio中的配置> SDK管理器.

Go to Configure>SDK Manager in your Android Studio.

选择 SDK工具标签并安装 Google Play许可库

这篇关于反应本机|无法安装该应用程序.请使用SDK Manager接受所有必要的SDK许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆