Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

后端 未结 24 1753
孤城傲影
孤城傲影 2020-11-22 02:30

I\'ve always programmed Android with Eclipse and decided to start migrating to Android Studio. I decided to use the same SDK I already had for Eclipse, then:

  • S
24条回答
  •  野性不改
    2020-11-22 03:06

    As others have already mentioned your compile sdk version must match your support library's major version. This is however, also relevant for subprojects should you have any.

    In case you do, you can set your subprojects compile sdk versions with the following script:

    subprojects { subproject ->
    afterEvaluate{
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
          }
       }
    }
    

    Add this script in your root build.gradle file.

提交回复
热议问题