com.android.ide.common.process.ProcessException:无法执行aapt!我能做什么?

Cai*_*ota 14 android build aapt ionic-framework

当我试图在Android设备上运行时,我收到错误!我不知道发生了什么!

我该怎么做才能解决它?

FAILURE:构建因异常而失败.

建筑失败

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).
Run Code Online (Sandbox Code Playgroud)

解决了

解决:重新创建项目并再次添加功能!

Joc*_*acx 19

只需将此代码放在build.gradle的最后一部分

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}
Run Code Online (Sandbox Code Playgroud)

  • 有两个`build.gradle`文件,其中一个在app中添加,收到错误 (3认同)
  • 在AppName / platforms / android / build.gradle中 (2认同)

小智 5

如果您将 v4 v7 版本更新为 26.0.0,您还应该将 CompileSdkVersion 和 BuildToolsVersion 更改为 26.0.0