android - 由于未接受许可协议(protocol),run-android 无法运行

标签 android react-native

失败:构建失败,出现异常。

  • 出了什么问题: 配置项目“:app”时出现问题。

    You have not accepted the license agreements of the following SDK components: [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]. Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager. Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出

遇到这种情况怎么办?

最佳答案

如果在 Android Studio 中打开 SDK Manager:

  1. 打开 Android SDK 管理器。

  2. 单击“SDK 工具”选项卡并选中屏幕右下角的“显示包详细信息”复选框。

  3. 勾选“Android SDK Build-Tools”下的 23.0.1 选项。

  4. 点击“应用”。系统应该会提示您提供许可协议(protocol)。接受许可,您就完成了。

  5. 尝试重新运行您的 react-native 应用。

如果不使用 Android Studio:

  1. 在您的 Android SDK 文件夹(可能在 tools 或 platform-tools 文件夹中)打开 SDK Manager

  2. 选中版本号为 23.0.1 的“Android SDK 构建工具”旁边的复选框。

  3. 点击“安装 1 个包”(它可能是不同的数字。如果您不想安装/更新任何其他东西,请取消选中其他框)

  4. 您应该会在某个时候看到一份许可协议(protocol)。接受它并让 SDK 管理器为您安装这些东西。

  5. 尝试重新运行您的 react-native 应用。

关于android - 由于未接受许可协议(protocol),run-android 无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44099985/

相关文章:

react-native - React Native - SectionList numColumns 支持

node.js - 如何在 NGINX 服务器上使用 Meteor 服务多个 React Native 应用程序?

android - 未找到样式 TextAppearance.Holo

java - 如何为传感器创建按钮

Javascript 后退按钮事件监听器覆盖 android 设备后退按钮

android - Android 中的默认字体特征是什么?

Android 虚拟设备和 Intel HAXM

javascript - React-Native 导入库并在多个组件中可用

android - 应用程序未启动 - React Native (Android)

reactjs - 使用 display none 代替条件状态渲染