如何修复eror app\build\intermediates\res\merged\debug\values-v24\values-v24.xml

Mr *_*eki 16 android android-support-library android-gradle-plugin

我在构建项目时遇到错误.

错误:

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
C:\Users\MR Maleki\Desktop\WhoIsBetter2\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Run Code Online (Sandbox Code Playgroud)

摇篮:

  compileSdkVersion GLOBAL_COMPILE_SDK as int
    buildToolsVersion GLOBAL_BUILD_TOOLS

     compile fileTree(include: ['*.jar'], dir: 'libs')
        //----------------- Android Support Library --------------------------------
        compile "com.android.support:appcompat-v7:$GLOBAL_SUPPORT_LIBRARY_VERSION"
        compile "com.android.support:design:$GLOBAL_SUPPORT_LIBRARY_VERSION"
        compile "com.android.support:gridlayout-v7:$GLOBAL_SUPPORT_LIBRARY_VERSION"
        compile "com.android.support:cardview-v7:$GLOBAL_SUPPORT_LIBRARY_VERSION"
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?你会建议什么来解决这个问题?

Tan*_*.7x 17

当支持库的主要版本与您的编译SDK版本不匹配时,通常会发生这种情况.

例如,如果使用SDK版本24进行编译,则必须使用支持库的24.xx版(反之亦然).

另请参阅:检索项目的父项时出错:升级到AppCompat v23后找不到与给定名称匹配的资源

  • 这不起作用.针对v23编译的SDK,但是原始海报所指示的生成文件会生成值-v24.当使用支持库23进行编译时,会再次明确使用SDK v23,并且所有项目依赖性都是兼容的.然而神奇的是,带有"错误检索项目的父项:......"错误的值-v24是新的. (3认同)