Android Studio 3.0无法解析符号主题 [英] Android Studio 3.0 cannot resolve symbol Theme

查看:64
本文介绍了Android Studio 3.0无法解析符号主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如style.xml中所述,存在一个奇怪的错误,显示无法解析符号主题",这很奇怪.

As stated in style.xml, there is a weird error, which shows Cannot resolve symbol 'Theme', which is quite strange.

查看错误图片:-

我的项目规格:-

使用Android Studio 3.0

Using Android Studio 3.0

和gradle版本3.0.0

and gradle version 3.0.0

and distributionUrl = https://services.gradle.org/distributions/gradle-4.1-all.zip

and distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

-

尝试通过转到文件">使高速缓存无效/重新启动">使无效并重新启动"来清除高速缓存,但无济于事,因为错误仍然存​​在.

Tried clearing the cache by going to File > Invalidate Cache/Restart > Invalidate and Restart, but to no avail, as the error persists.

推荐答案

另一个可能的原因是:未为构建脚本设置Google的maven存储库.

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

打开项目的主版本.gradle添加行:

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

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

否则,它可能无法下载Android Studio Gradle插件3.0+.它不在jCenter中分发,而是在Google的maven存储库中分发.

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.

这篇关于Android Studio 3.0无法解析符号主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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