无法解析实施"com.google.firebase:firebase-messaging:15.0.2" [英] Failed to resolve implementation 'com.google.firebase:firebase-messaging:15.0.2'
问题描述
我正在集成Firebase消息传递的版本是:
I am Integrating Firebase messaging for a version is:
'com.google.firebase:firebase-messaging:15.0.2'
我的类路径是:-
classpath 'com.google.gms:google-services:3.2.0'
我遇到了以下错误:-
无法解决:firebase-messaging打开文件
Failed to resolve: firebase-messaging Open File
推荐答案
更改此内容:
classpath 'com.google.gms:google-services:3.2.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
对此:
classpath 'com.google.gms:google-services:4.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
说明:
在这种情况下,将firebase-messaging:15.0.2
与google-services:4.0.1
一起使用将是可行的,因为最重要的是更新3.2.0
上方的google-services
,这是因为需要google-services:3.3.0
才能使用来自15.0及更高版本.您可以查看此博客文章.解释了Firebase库版本控制中的更改.
Here in this case using firebase-messaging:15.0.2
with google-services:4.0.1
would work, since the most important thing was updating google-services
above 3.2.0
, and that's because google-services:3.3.0
is needed to be able to use the firebase library from version 15.0 and above. You can check this blog post. that explains the changes in versioning of firebase libraries.
但是最好还是更新google-services
插件,以防止其他依赖项引起的其他错误.
But it is still better to update the google-services
plugin to prevent any other errors with other dependencies.
注意:
小于15.0.0
的版本位于google maven存储库中,因此您可以在gradle中使用它们.但是,如我的回答
The versions less than 15.0.0
are in google maven repository, so you can use them in gradle. But, you cannot mix version 15.0.0
with a version less than 15.0.0
and use google play services 4.0.1
, as said in my answer here. That's why it is better to update firebase libraries to the latest versions.
这篇关于无法解析实施"com.google.firebase:firebase-messaging:15.0.2"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!