Android Cannot resolve symbol '?attr/selectableItemBackground'

后端 未结 10 1953
北恋
北恋 2020-12-05 09:11


        
10条回答
  •  孤城傲影
    2020-12-05 09:39

    2 options:

    Option 1

    Another possible reason is: Google's maven repository is not set for the build script.

    Open your project's main build.gradle add this line:

    buildscript {
        repositories {
            google()  <-- this
            // Be also sure that google() is before jcenter()
        }
    }
    

    Without this, it may not be able to download the Android Studio Gradle plugin 3.0+. It's not distributed in jCenter but in the Google's maven repository.

    Option 2

    Run this command in root of project and resync project

    Linux:

    rm .idea/libraries/Gradle__com_android_support_*.xml

    Windows:

    del .idea\libraries\Gradle__com_android_support_*.xml

提交回复
热议问题