繁体   English   中英

FAILURE:构建失败,出现异常。 反应原生

[英]FAILURE: Build failed with an exception. ReactNative

尝试使用构建我的 android 项目

react-native run-android

但是,我不断收到同样的错误:

Warning: License for package Android SDK Platform 26 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK 
components:
[Android SDK Platform 26, Android SDK Build-Tools 26.0.2].
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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or -- 
debug option to get more log output.

BUILD FAILED

我尝试过的:

  1. 我尝试使用sdkmanager --licenses来接受所有许可证
  2. 我更新了我的 SDK
  3. 我使用git clean -d -fx清理了我的项目
  4. 我确保安装了最新的 Android SDK

我该如何解决?

我建议你通过 Android Studio 构建这个 React-native 应用程序。

使用 Android Studio 在项目的/android文件夹中打开 Android 项目。

项目打开 Android Studio 后会提示"update"need skip 使用dialog for download SDK, you accept and continue

完成设置后,您可以通过菜单Build\\Build APK或通过菜单Run\\Run App直接运行应用程序来构建您的 RN Android 在此处输入图片说明 在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM