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 resolve symbol '?attr/actionBarSize
Xml code:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="@android:color/white"/>
Dependencies:
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
Nothing helped, but changing:
?attr/actionBarSize
to?android:attr/actionBarSize
did the job.That's actually a bug in few versions. Even if you won't fix it, Android will automatically fix it at runtime.
Try to add this in your build.gradle(app) dependencies:
this work:
delete all file in $HOME/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar
Changed all Support Library versions to the newest
27.1.1
and the error was gone.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
to
Hope it can help somebody.
Your buildToolsVersion version differs from version in dependencies (e.g. buildToolsVersion is 27.0.0 but implementation 'com.android.support:support-v4:27.0.1'). Make them the same.