简体   繁体   English

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

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

I've created a new project. 我创建了一个新项目。 I installed "Browser / Android" as the platform. 我安装了“浏览器/ Android”作为平台。 Only standard plug-ins installed; 仅安装标准插件; cordova-plugin-device 2.0.2 "Device" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-plugin-device 2.0.2“设备” cordova-plugin-whitelist 1.3.3“白名单”

It makes a smooth compilation in the browser. 它可以在浏览器中进行平滑编译。 (The project is already hollow) However, I can't get results when I want to compile on android device. (该项目已经是空心的)但是,当我想在android设备上进行编译时,无法获得结果。 The output is as follows. 输出如下。 I also share SDK information. 我也分享SDK信息。 I don't know where I'm making a mistake. 我不知道我在哪里犯错。

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>

At your Android SDK Build Tools uninstall version 28.0.2 and install version 28.0.3. 在您的Android SDK Build Tools卸载版本28.0.2并安装版本28.0.3。

These are in your screenshot 1st Window the 3rd and the 4th packages. 这些在您的屏幕快照1st Window中的第3和第4个软件包中。

It looks that cordova does not have the permission to do it as it posts the error Probably the SDK is read-only . 似乎Cordova无权执行此操作,因为它会发布错误, Probably the SDK is read-only

Another possible solution for that is to start the cmd as an administrator and try again. 另一个可行的解决方案是以管理员身份启动cmd,然后重试。

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

相关问题 FAILURE:构建失败并出现异常。 Cordova - FAILURE: Build failed with an exception. Cordova FAILURE:构建失败,出现异常。 反应原生 - FAILURE: Build failed with an exception. ReactNative Mapbox - FAILURE:构建失败并出现异常。 (扑) - Mapbox - FAILURE: Build failed with an exception. (Flutter) FAILURE:构建失败并出现异常。 (扑) - FAILURE: Build failed with an exception. (flutter) FAILURE:构建失败并出现异常。 任务“:app:mergeDebugResources”执行失败 - FAILURE: Build failed with an exception. Execution failed for task ':app:mergeDebugResources' 失败:构建失败,发生异常。 在volley \\ bintray.gradle中 - FAILURE: Build failed with an exception. in volley\bintray.gradle FAILURE:构建失败并出现异常。 alan_voice:compileReleaseKotlin'. 飘飘然 - FAILURE: Build failed with an exception. alan_voice:compileReleaseKotlin'. in flutter 我想解决此错误消息“失败:构建失败并出现异常。” - I want to solve this error message 'FAILURE: Build failed with an exception.' FAILURE:构建失败并出现异常。 我无法构建我的 flutter 应用程序:'( - FAILURE: Build failed with an exception. I cant build my flutter app :'( FAILURE生成失败,科尔多瓦例外。 运行构建命令时 - FAILURE Build failed with an exception cordova. when build command run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM