Cannot resolve symbol '?attr/actionBarSize' after updating Android Studio from 2.3 to 3.0 for buildToolsVersion '26.0.2'

后端 未结 16 2177
旧巷少年郎
旧巷少年郎 2021-01-30 08:00

After updating Android Studio from 2.3 to 3.0 I changed buildToolsVersion from 26.0.0 to 26.0.2 and after then I am getting this error:

Cannot reso         


        
相关标签:
16条回答
  • 2021-01-30 08:27

    Update all your library versions to 26.1.0 (to the most recent version) and also add:

    compile 'com.android.support:support-v4:26.1.0'
    

    if you are using Android Studio 3.0.0 and above then use

    implementation 'com.android.support:support-v4:26.1.0'
    

    Sync your project and the error will automatically resolve because ?attr/actionBarSize is part of v4 library.

    0 讨论(0)
  • 2021-01-30 08:29

    Maybe you hava upgraded the version of gradle. when my gradle version is 4.4 and plugin version is 3.1.1.It is ok.

    0 讨论(0)
  • 2021-01-30 08:30

    Good day, I know this is a bit late.

    but I have encountered this one too, when I updated to Android Studio 3.0

    what i did is I changed

    compile 'com.android.support:support-v4:26.1.0'
    

    to

    implementation 'com.android.support:support-v4:26.1.0'
    

    Hope it can help somebody.

    0 讨论(0)
  • 2021-01-30 08:31

    In the project directory hierarchy switch "Android" to "Project". Then delete a folder ".idea/libraries", only "libraries". Select an option from the menu "File -> Invalidate Caches / Restart... -> Invalidate and Restart".

    0 讨论(0)
  • 2021-01-30 08:31

    this work:

    delete all file in $HOME/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar

    0 讨论(0)
  • 2021-01-30 08:31

    Change R.attr.actionBarSize to androidx.appcompat.R.attr.actionBarSize.

    0 讨论(0)
提交回复
热议问题