com.android.ide.common.process.ProcessException:无法执行aapt!我能做什么?
我尝试在Android设备上运行时出错!我不知道发生了什么事 我能做些什么来解决它 失败:生成失败,出现异常 构建失败com.android.ide.common.process.ProcessException:无法执行aapt!我能做什么?,android,ionic-framework,build,aapt,Android,Ionic Framework,Build,Aapt,我尝试在Android设备上运行时出错!我不知道发生了什么事 我能做些什么来解决它 失败:生成失败,出现异常 构建失败 Total time: 7.791 secs * What went wrong: Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt * Try: Run with -
Total time: 7.791 secs
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:373: AAPT: Attribute "theme" already defined with incompatible format.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:359: AAPT: Original attribute defined here.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values-v26\values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:373: error: Attribute "theme" already defined with incompatible format.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values\values.xml:359: Original attribute defined here.
C:\tmp\myproj\platforms\android\build\intermediates\res\merged\debug\values-v26\values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[ERROR] An error occurred while running cordova run android (exit code 1).
已解决
已解决:重新创建项目并再次添加功能 如果将v4 v7版本更新为26.0.0, 您还应该更改CompileSDK版本和BuildToolsVersion
到26.0.0只需将此代码放在最后一部分的build.gradle中
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}
对我来说,这个错误的奇怪原因是我在布局中缺少了一个可绘制的。我从另一个项目复制了布局,在运行我的项目之前忘记了复制可绘制的布局。
此外,请检查布局中的活动名称是否没有空格。此问题来自不匹配的项目环境和执行平台环境。 尝试创建新项目并在相同的平台环境中运行。 如果它运行,复制粘贴旧的项目src文件
$ ionic start
$ cd "project_name"
$ ionic cordova platform add android
$ ionic cordova run android
copy-paste old project src files
重新创建项目是什么意思。你的意思是删除笔记模块和平台吗?有两个
build.gradle
文件,其中一个是在应用程序中添加的,在AppName/platforms/android/build.gradle中出错,这两个文件也会有同样的问题。。。有什么建议吗??我已经为此投入了3天时间。