任务 ':CordovaLib:processDebugResources' 执行失败.>com.android.ide.common.process.ProcessException:无法执行 aapt [英] Execution failed for task ':CordovaLib:processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt
问题描述
我正在通过做一个测试应用程序来学习如何使用 Ionic,但我已经遇到这个问题两天了.我一直在寻找可能的解决方案,但没有一个对我有用.
I am learning how to use Ionic by doing a test application but I have had this problem for two days. I have looked for possible solutions but none has worked for me.
当我想在我的 android 手机上测试我的应用程序时出现问题.使用此命令时 ionic cordova run android
并给我以下错误
The problem arises when I want to test my application on my android phone.
When using this command ionic cordova run android
and gives me the following error
FAILURE:构建失败,出现异常.
FAILURE: Build failed with an exception.
出了什么问题:
任务:CordovaLib:processDebugResources"的执行失败.com.android.ide.common.process.ProcessException: 执行 aapt 失败
Execution failed for task ':CordovaLib:processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt
[ERROR] 运行 cordova run android 时出错(退出代码 1).
[ERROR] An error occurred while running cordova run android (exit code 1).
我不确定出了什么问题.我的应用程序非常简单,它基于 Ionic 的模板 ionic start myApp tabs
,我使用的是 Ionic 原生插件 Geolocation.
I'm not sure what's wrong. My application it's very simple it's based on Ionic's template ionic start myApp tabs
and I'm using Ionic native plugin Geolocation.
我已经运行 ionic info
并返回这个
I've running ionic info
and returns this
cli packages:
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.4
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
我还查看了 Cordova 的官方文档以了解 Android 开发,我的 Java 和 Android 路径都可以.
I also checked the official Cordova's doc for Android development and my paths for Java and Android are OK.
还有 ionic cordova 要求
,一切看起来都很好.
Also with ionic cordova requirements
everything looks to be OK.
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-23
Gradle: installed C:Program FilesAndroidAndroid Studiogradlegradle-4.1ingradle
感谢您的帮助.
推荐答案
这是由于兼容插件.如果您有旧版本(低于 1.2.0)并设置 cordova-android@6.3.0
This is due to compat plugin. Remove that plugin if you have older version (less than 1.2.0) and set cordova-android@6.3.0
cordova 插件 rmcordova-plugin-compat --force
cordova plugin rm cordova-plugin-compat --force
cordova 插件添加cordova-plugin-compat@1.2.0
cordova plugin add cordova-plugin-compat@1.2.0
cordova 平台 rm android
cordova platform rm android
离子cordova平台添加android@6.3.0
ionic cordova platform add android@6.3.0
处理我的案子.谢谢:)
Working at my case. Thanks :)
这篇关于任务 ':CordovaLib:processDebugResources' 执行失败.>com.android.ide.common.process.ProcessException:无法执行 aapt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!