繁体   English   中英

失败:构建失败,发生异常。 -科尔多瓦

[英]FAILURE: Build failed with an exception. - Cordova

我创建了一个新项目。 我安装了“浏览器/ Android”作为平台。 仅安装标准插件; cordova-plugin-device 2.0.2“设备” cordova-plugin-whitelist 1.3.3“白名单”

它可以在浏览器中进行平滑编译。 (该项目已经是空心的)但是,当我想在android设备上进行编译时,无法获得结果。 输出如下。 我也分享SDK信息。 我不知道我在哪里犯错。

SDK萤幕撷取画面

C:\MyApp>cordova run android -device

Checking Java JDK and Android SDK versions 

ANDROID_SDK_ROOT=undefined (recommended setting)

ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk (DEPRECATED)

Subproject Path: CordovaLib

Subproject Path: app

> Configure project :app
WARNING: The specified Android SDK Build Tools version (28.0.2) is ignored, as i
t is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.
0.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.2'" from your build.gr
adle file, as each version of the Android Gradle Plugin now has a default versio
n of the build tools.
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\25.0.1\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\25.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\25.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.1\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\28.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\an
droid\m2repository\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\auto\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\google_play_services\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\instantapps\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\m2repository\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\market_apk_expansion\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\market_licensing\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\simulators\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\usb_driver\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\webdriver\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platform-
tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-23\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-25\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-26\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-27\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-28\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-Q\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\system-im
ages\android-28\android-tv\x86\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\system-im
ages\android-28\default\x86_64\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\tools\pac
kage.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\25.0.1\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\25.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\25.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.1\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\26.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\build-too
ls\28.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\an
droid\m2repository\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\auto\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\google_play_services\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\instantapps\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\m2repository\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\market_apk_expansion\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\market_licensing\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\simulators\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\usb_driver\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\webdriver\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platform-
tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-23\package.xml. Probably the SDK is read-only

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
  To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to anot
her, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\Program Files (x86)\Android\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

BU?LD FAILED in 1s
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-25\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-26\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-27\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-28\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\platforms
\android-Q\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\system-im
ages\android-28\android-tv\x86\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\system-im
ages\android-28\default\x86_64\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files (x86)\Android\android-sdk\tools\pac
kage.xml. Probably the SDK is read-only
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\Program Fi
les (x86)\Android\android-sdk\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
C:\MyApp\platforms\android\gradlew: Command failed with exit code 1 Error output
:
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
  To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to anot
her, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\Program Files (x86)\Android\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

BU?LD FAILED in 1s

C:\MyApp>

在您的Android SDK Build Tools卸载版本28.0.2并安装版本28.0.3。

这些在您的屏幕快照1st Window中的第3和第4个软件包中。

似乎Cordova无权执行此操作,因为它会发布错误, Probably the SDK is read-only

另一个可行的解决方案是以管理员身份启动cmd,然后重试。

暂无
暂无

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

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