Android Studio 突然无法解析符号 [英] Android Studio suddenly cannot resolve symbols

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

问题描述

Android Studio 0.4.2 运行良好,今天我打开它,几乎所有东西都是红色的,并且自动完成功能停止工作.我查看了导入,AS 似乎告诉我它突然找不到 android.support.v4(为我提供了删除未使用的导入的选项).(android.support.v7 似乎还不错).

Android Studio 0.4.2 was working fine and today I opened it and almost everything was red and the auto-completion had stopped working. I look at the imports and AS seems to be telling me it can't find android.support.v4 all of a sudden (offering me the option to remove the unused imports). (android.support.v7 seems to be fine though).

我尝试过的事情:

  • 重建项目
  • 清理项目
  • 与 Gradle 文件同步
  • 关闭项目,关闭 AS 并重新启动/重新打开
  • 文件 > 使缓存无效/重新启动
  • 检查 Lint,没有发现任何明显的东西
  • 在 SDK 管理器中仔细检查所有支持库是否是最新的
  • 检查我的 Build.gradle,虽然没有任何变化,并且与往常一样,但它一直在工作.

这里是相关的:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.0'

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.0.0'
    compile 'com.android.support:gridlayout-v7:19.0.0'
    compile 'com.android.support:appcompat-v7:19.0.0'
    compile 'com.google.android.gms:play-services:4.0.30'
    compile project(':libraries:facebook')
    compile files('libs/core.jar')
}

当我点击与 Gradle 同步"并打开项目设置"时,我收到一个红色错误,告诉我我有重复的库引用并删除未使用的引用.

When I hit "Sync with Gradle" and open "Project Settings" I get a red error telling me I have duplicate library references and to remove the unused ones..

我的项目编译并运行良好,但我真的需要自动完成工作!!有人有什么建议吗?

My project compiles and runs fine but I really need the autocomplete working!! Does anyone have any suggestions?

推荐答案

您已经列出了大多数有用的东西,但您可以尝试:

You've already gone down the list of most things that would be helpful, but you could try:

  • 退出 Android Studio
  • 备份您的项目
  • 删除所有 .iml 文件和 .idea 文件夹
  • 重新启动 Android Studio 并重新导入您的项目

顺便说一下,您在项目结构"对话框中看到的错误消息大部分都是假的.

By the way, the error messages you see in the Project Structure dialog are bogus for the most part.

更新:

Android Studio 0.4.3 在 Canary 更新频道中可用,有望解决大部分问题.可能存在一些挥之不去的问题;如果您在 0.4.3 中看到它们,请告诉我们,并尝试为我们提供一组可靠的重现步骤,以便我们确保处理所有代码路径.

Android Studio 0.4.3 is available in the canary update channel, and should hopefully solve most of these issues. There may be some lingering problems; if you see them in 0.4.3, let us know, and try to give us a reliable set of steps to reproduce so we can ensure we've taken care of all code paths.

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

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