1

我在 Visual Studio 2017 中有一个 Cordova 应用程序项目,到目前为止它一直在构建良好。该项目没有进行任何更改。

现在我们得到这个构建错误:

1>MSBUILD : cordova-build error : C:\Users\Adam.Akers\Documents\Visual Studio 2015\Projects\BCA\HH\BcaView\platforms\android\build\intermediates\res\merged\debug\values\values.xml:173: AAPT: Attribute "layout_anchorGravity" already defined with incompatible format.    
1>MSBUILD : cordova-build error : C:\Users\Adam.Akers\Documents\Visual Studio 2015\Projects\BCA\HH\BcaView\platforms\android\build\intermediates\res\merged\debug\values\values.xml:172: AAPT: Original attribute defined here.    
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.    
1>MSBUILD : cordova-build error : * What went wrong:    
1>MSBUILD : cordova-build error : Execution failed for task ':processDebugResources'.    
1>MSBUILD : cordova-build error : > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\ProgramData\Microsoft\AndroidSDK\25\build-tools\25.0.3\aapt.exe'' finished with non-zero exit value 1
1>MSBUILD : cordova-build error : * Try:    
1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.    
1>MSBUILD : cordova-build error : Picked up _JAVA_OPTIONS: -Xmx512M

任何帮助都会很棒。我已经删除了插件并检查了 SDK 的版本,但我们什么也没改变

4

1 回答 1

1

AAPT:属性“layout_anchorGravity”已经用不兼容的格式定义。AND 25.0.3\aapt.exe'' 以非零退出值 1 结束

根据错误信息“ AAPT: Attribute "layout_anchorGravity" already defined with in compatible format. ",看来您已经定义了一个layout_anchorGravity在应用程序代码中命名的自定义属性,该属性与 Android O 中引入的 android-namespaced font 属性有某种冲突。尝试重命名或删除该自定义属性,例如:

<declare-styleable name="AATextView">
    <attr name="layout_anchorGravity" format="string"/>
</declare-styleable>

<declare-styleable name="AATextView">
    <attr name="typeface" format="string"/>
</declare-styleable>

认证:错误:属性“字体”已使用不兼容的格式定义

希望这可以帮助。

于 2018-06-01T08:11:46.033 回答