好的,我有一个问题作为标题。它说
Error:(69, 27) error: cannot access Task class file for com.google.android.gms.tasks.Task not found
我不知道这意味着什么以及如何解决它。我几乎整天都在寻找它,但没有任何帮助。
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'key'
keyPassword 'pass'
storeFile file('C:/Users/Alan/Nameless_release_key.jks')
storePassword 'pass'
}
}
compileSdkVersion 26
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.sstudio.nameless"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
signingConfig signingConfigs.config
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui-database:2.3.0'
compile 'com.android.support:recyclerview-v7:26.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
这是我的 gradle 控制台输出
Executing tasks: [:app:assembleDebug]
Parallel execution is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\Alan\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:prepareAndroidArchCoreRuntime100Alpha8Library
:app:prepareAndroidArchLifecycleExtensions100Alpha8Library
:app:prepareAndroidArchLifecycleRuntime100Alpha8Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2602Library
:app:prepareComAndroidSupportAppcompatV72602Library
:app:prepareComAndroidSupportRecyclerviewV72602Library
:app:prepareComAndroidSupportSupportCompat2602Library
:app:prepareComAndroidSupportSupportCoreUi2602Library
:app:prepareComAndroidSupportSupportCoreUtils2602Library
:app:prepareComAndroidSupportSupportFragment2602Library
:app:prepareComAndroidSupportSupportMediaCompat2602Library
:app:prepareComAndroidSupportSupportV42602Library
:app:prepareComAndroidSupportSupportVectorDrawable2602Library
:app:prepareComFirebaseuiFirebaseUiDatabase230Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks1104Library
:app:prepareComGoogleFirebaseFirebaseAnalytics1001Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1001Library
:app:prepareComGoogleFirebaseFirebaseCommon1104Library
:app:prepareComGoogleFirebaseFirebaseCore1001Library
:app:prepareComGoogleFirebaseFirebaseDatabase1104Library
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection1104Library
:app:prepareComGoogleFirebaseFirebaseIid1001Library
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: C:\Users\Alan\Desktop\New folder\Nameless\app\google-services.json
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac
C:\Users\Alan\Desktop\New folder\Nameless\app\src\main\java\com\sstudio\nameless\ChatActivity.java:69: error: cannot access Task
me.push().setValue("online");
^
class file for com.google.android.gms.tasks.Task not found
1 error
FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
38 actionable tasks: 33 executed, 5 up-to-date
帮帮我。如果您需要更多信息,我会更新它。
最佳答案
谢谢大家的回复。现在问题消失了。 将每个依赖项 和平台插件更新到其最新版本 解决了这个问题。对于在场的所有人,永远不要……永远不要忽视更新。除非你想撞头流血。
关于android - 无法访问 com.google.android.gms.tasks 的任务类文件。找不到任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46345569/