ionic cordova构建错误:无法安装android sdk包



我试图从一个ionic cordova项目生成apk文件,在我的ubuntu机器中安装了jdk和android sdk后,设置路径变量并执行"ionic cordova平台添加android";我执行了命令";ionic cordova构建android";其在运行一段时间后产生以下错误。

请告诉我我需要做什么,我已经做了一整天了。

Starting a Gradle Daemon (subsequent builds will be faster)
WARNING: The specified Android SDK Build Tools version (27.0.1) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.0.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (27.0.1) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.0.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Observed package id 'build-tools;debian' in inconsistent location '/usr/lib/android-sdk/build-tools/27.0.1' (Expected '/usr/lib/android-sdk/build-tools/debian')
Observed package id 'build-tools;debian' in inconsistent location '/usr/lib/android-sdk/build-tools/27.0.1' (Expected '/usr/lib/android-sdk/build-tools/debian')
File /root/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 29.0.2 in /usr/lib/android-sdk/licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
Checking the license for package Android SDK Platform 29 in /usr/lib/android-sdk/licenses
Warning: License for package Android SDK Platform 29 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
platforms;android-29 Android SDK Platform 29
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: /usr/lib/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 28m 36s

您需要接受许可证,打开androidstudio,您会找到配置按钮,点击那里并进入manage-sdk。一个更简单的方法是在androidstudio中创建一个空白项目并构建它。它也将接受这些条款。

这是

最新更新