android.databinding.Observable 的位置是什么?

What is the location of android.databinding.Observable?

Android Studio 3.0.1 抱怨找不到这个 class。即使它构建了,它也只是显示了一条可怕的红色下划线。这是我的第一个问题,但也很好奇这个难以捉摸的地方在哪里 class?

在扩展库中查找它没有显示:/Library/Android/sdk/extras/android/m2repository/com/android/databinding/library/1.3.1/library-1.3.1-sources.jar

并在网上寻找来源,我也很短: https://android.googlesource.com/platform/frameworks/data-binding/+/c9a5d6f140f732ca0ff279a4b1ee315072e1c422/library/src/main/java/android/databinding

Android Studio 3.0.1 is complaining that it can't find this class. Even though it builds, it just shows an awful red underline

真奇怪。我刚刚在AS 3.0.1中拉起一个使用数据绑定框架的项目,我可以导入android.databinding.Observable就好了。

话又说回来,Android Studio 是……古怪。

where IS this elusive class?

在我的环境中,它在 com.android.databinding:baseLibrary:3.0.1:

如果启用数据绑定,Android Gradle 插件会将 com.android.databinding:adapters:1.3.1com.android.databinding:library:1.3.1 添加到您的依赖项中。

您提供的 link 指的是一段时间以前的提交 SHA c9a5d6f

git clone https://android.googlesource.com/platform/frameworks/data-binding
cd data-binding
git show c9a5d6f

commit c9a5d6f140f732ca0ff279a4b1ee315072e1c422
Author: George Mount <mount@google.com>
Date:   Fri Jul 10 15:43:11 2015 -0700

查看 "current"(截至 2017 年 11 月 27 日),它存在:

ls baseLibrary/src/main/java/android/databinding/Observable.java