无法解决:play-services-tasks

Failed to resolve: play-services-tasks(无法解决:play-services-tasks)
本文介绍了无法解决:play-services-tasks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

近 48 小时以来,我一直在尝试将 FCM 添加到我的 android 应用程序中.我在 Android Studio 上一直因这两个错误而失败.我已经尝试了此 中的所有解决方案发布.我仍然无法修复它.

I have been tryong to add FCM to my android application for almost 48 hours now. I am keep on failing with these two errors on Android Studio. I have tried all the solutions in this post. Still I couldn't fix it.

我希望将 Firebase 云消息传递集成到我的应用中.所以我做了以下事情.

I want firebase cloud messaging to be integrated in my app. So I did the followings.

  • 在 Firebase 控制台中创建了一个应用
  • 包含 .json 配置文件
  • 添加了 SDK
  • 实现 'com.google.firebase:firebase-messaging:17.0.0'(在应用级 gradle 中)
  • apply plugin: 'com.google.gms.google-services' (最后在应用级 gradle 文件中行)
  • 类路径 'com.google.gms:google-services:4.0.1'(在项目级别的gradle中)
  • 添加了存储库google()(在项目级gradle中)
  • Created an app in the firebase console
  • Included the .json config file
  • Added the SDK
  • implementation 'com.google.firebase:firebase-messaging:17.0.0' (In the app level gradle)
  • apply plugin: 'com.google.gms.google-services' (In the app level gradle file last line)
  • classpath 'com.google.gms:google-services:4.0.1' (In the project level gradle)
  • Added the repository google() (In the project level gradle)

我已经尝试过多次同步,但我不断收到错误

I have tried syncing many times and I keep on getting the error

无法解决:play-services-tasks 打开文件

Failed to resolve: play-services-tasks Open File

无法解决:play-services-basement 打开文件

Failed to resolve: play-services-basement Open File

附带说明,我使用的是 gradle 插件 3.1.3

On a side note, I am using the gradle plugin 3.1.3

    classpath 'com.android.tools.build:gradle:3.1.3'

请有人帮我一下.

推荐答案

jcenter() 有时充当某些 Google 依赖项的镜像存储库.在 Gradle 构建过程中,它会在 repositories {...} 块中列出的第一个条目中查找依赖项.因此,如果此存储库损坏或任何依赖项发生不良情况,该过程将失败.

jcenter() sometimes act as a mirror repository for some Google dependencies. During Gradle building process, it looks for dependencies in the first entry listed in your repositories {...} block. So if this repository is broken or something bad occurs with any dependency the process will fail.

这里有推荐的仓库列表顺序

Here there is a recommended order for repository list

    repositories {
        google()
        maven {
            url 'https://maven.google.com/'
        }
        jcenter()
    }

这篇关于无法解决:play-services-tasks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)