将build.toolsVersion '26 .0.2'的Android Studio从2.3更新到3.0后,无法解析符号'?attr/actionBarSize' [英] Cannot resolve symbol '?attr/actionBarSize' after updating Android Studio from 2.3 to 3.0 for buildToolsVersion '26.0.2'

查看:311
本文介绍了将build.toolsVersion '26 .0.2'的Android Studio从2.3更新到3.0后,无法解析符号'?attr/actionBarSize'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Android Studio从2.3更新到3.0后,我将buildToolsVersion从26.0.0更改为26.0.2,然后出现此错误:

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代码:

<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"/>

依赖项:

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'

推荐答案

没有任何帮助,但进行了以下更改:

Nothing helped, but changing:

?attr/actionBarSize?android:attr/actionBarSize完成了任务.

实际上,这是几个版本中的错误.即使您不会修复它,Android也会在运行时自动修复它.

That's actually a bug in few versions. Even if you won't fix it, Android will automatically fix it at runtime.

这篇关于将build.toolsVersion '26 .0.2'的Android Studio从2.3更新到3.0后,无法解析符号'?attr/actionBarSize'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆