rxjava,无法在Intellij IDEA中解析符号'just'

时间:2016-12-14 11:38:01

标签: java android intellij-idea

enter image description here

适用于:

Observable<String> observable = Observable.just("");

但无法解析just

中的符号Observable.just("");

我确定已导入rxjava2.jarObservable.just("")在Eclipse中表现良好,但在IDEA中表现不佳。

3 个答案:

答案 0 :(得分:1)

文件->项目结构->模块-> +按钮单击->库-> Maven

搜索框-> Rx Java

通过将阶段应用于您的项目。

Maven Repos

答案 1 :(得分:0)

I had the very same issue; I also saw similar behavior in the past, which drove me crazy for a long time, resulting in reinstalling the IDE.

Turns out, the problem was due to IntelliJ's idea.max.intellisense.filesize setting. I had set it to 100KB, which was smaller than Observable's size.

This leads to weird results in IDEA/IntelliJ (mostly to the IDE not being able to find code/sources that are in the classpath.)

答案 2 :(得分:0)

当您要导入可观察的对象时,必须选择import io.reactivex.Observable; 但是您选择了错误导入android.database.Observable。

我希望这个提示对您有帮助