【发布时间】:2019-02-07 17:25:23
【问题描述】:
在 git 克隆并在另一台机器上构建后,我无法将 OnSuccessListener 导入到我的代码中(这在我以前的机器中解决得很好)。然而,该项目构建良好并在模拟器上运行。但是由于监听器没有解析,我无法进一步编写与 firebase 相关的代码。
我尝试清理项目、重建、使缓存无效,但仍然没有运气。
Gradle 依赖项,
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-firestore:17.0.4'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.android.support:design:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.github.drawers:SpinnerDatePicker:1.0.6'
implementation 'com.github.yalantis:ucrop:2.2.2'
}
【问题讨论】:
-
你试过删除
.idea/libraries吗? -
我尝试删除构建文件夹并重建项目。仍然项目构建良好,上面没有解决给定类中的错误。
-
试过删除 .idea/* 还是不行
-
我认为 OnSuccessListner 的方法可能属于不同的类。阻止此方法的代码。再写一遍,它会询问你想从哪个类创建方法。然后选择正确的。
-
您是否尝试过使用
import com.google.android.gms.tasks.OnSuccessListener;这一行手动导入OnSuccessListener?请回复@。
标签: android firebase google-play-services google-cloud-firestore cannot-find-symbol