Android的工作室表示,"不能解析符号"但项目编译符号、表示、工作室、项目

由网友(箛単☆球,啭ㄋ哆9)分享简介:我进口twitter4j在AndroidStudio,用我的build.gradle如下:I'm importing twitter4j in AndroidStudio, using the following in my build.gradle:dependencies {compile 'com.andro...

我进口twitter4j在AndroidStudio,用我的build.gradle如下:

I'm importing twitter4j in AndroidStudio, using the following in my build.gradle:

dependencies {
  compile 'com.android.support:support-v4:18.0.+'
  compile files('libs/twitter4j-core-3.0.4.jar')
}

该项目编译好了,我可以创建Twitter的对象,不会有问题。然而,在Android的工作室,任何引用该库显示无法解析符号,并显示为红色。什么我需要做的就是Android的工作室识别库?

The project compiles fine, and I can create twitter objects without a problem. However, in Android studio, anything referencing that library shows "cannot resolve symbol" and displays in red. What do I need to do to get Android Studio to recognize the library?

我已经尝试重建项目,./gradlew干净,和关闭并重新打开我的项目。

I have already tried rebuilding the project, ./gradlew clean, and closing and re-opening my project.

推荐答案

不知道这是否会工作或没有,但我唯一的想法至今:内右键单击文件树中的jar文件,并选择添加为库.. 。

No idea if this will work or not but my only thought so far: right click the jar file in file tree within AS and select "Add as library..."

编辑:你可以做文件 - >无效缓存...,然后选择无效,并重新启动选项来解决这个问题的

编辑2:此修复程序应适用于所有类似事件,而不是一个twitter4j特定分辨率的

阅读全文

相关推荐

最新文章