无法解决:播放服务任务 [英] Failed to resolve: play-services-tasks
问题描述
我已经尝试将FCM添加到我的android应用程序中将近48小时了.我一直在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
-
implementation 'com.google.firebase:firebase-messaging:17.0.0'
(在应用级别的gradle中) -
apply plugin: 'com.google.gms.google-services'
(在应用程序级别gradle文件中,最后 行) -
classpath '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'
有人可以在这里帮我吗?
Can someone please give me a hand here please.
推荐答案
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()
}
这篇关于无法解决:播放服务任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!