Describe the bug描述错误
After installing cordova-plugin-firebase, I am able to cordova run ios --device
but I am not able to cordova run android --device
.安装 cordova-plugin-firebase 后,我可以cordova run ios --device
但我不能cordova run android --device
。 When I do so, I get the following error:当我这样做时,我收到以下错误:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.1.0,17.1.0]], but resolves to 17.1.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
To Reproduce重现
Steps to reproduce the behavior:重现行为的步骤:
Expected behavior预期行为
I would hope that this plugin would work for both android and ios, but it seems like it is failing for cordova-android version 8.0.0.我希望这个插件对 android 和 ios 都适用,但对于 cordova-android 8.0.0 版来说似乎失败了。
Plugin Version插件版本
"dependencies": {
"android": "0.0.8",
"cordova-android": "^8.0.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.0.1",
"cordova-plugin-firebase": "2.0.5",
"cordova-plugin-inappbrowser": "^3.1.0",
"cordova-plugin-safariviewcontroller": "^1.6.0",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "1",
"phonegap-plugin-barcodescanner": "^8.1.0"
}
Additional context附加上下文
I was able to resolve this issue and get it to work by following this solution:我能够通过以下解决方案解决此问题并使其正常工作:
https://stackoverflow.com/questions/56654226/ionic-cordova-app-stopped-compiling-after-googles-june-17th-firebase-sdk-update https://stackoverflow.com/questions/56654226/ionic-cordova-app-stopped-compiling-after-googles-june-17th-firebase-sdk-update
As mentioned by @dpa99c I did the following:正如@dpa99c提到的,我做了以下事情:
cordova platform rm android
cordova plugin rm cordova-plugin-firebase
cordova plugin add cordova-plugin-firebasex
cordova plugin add cordova-plugin-androidx
cordova plugin add cordova-plugin-androidx-adapter
cordova platform add android
But after doing so, I was not able to get this to work in iOS.但这样做之后,我无法让它在 iOS 中工作。 Is there a plan to resolve this issue for cordova-android version 8.0.0?是否有计划为 cordova-android 版本 8.0.0 解决此问题?
en我面临同样的问题
en也面临同样的问题
en有同样的问题
enFor those still suffering from this, I recommend using a fork of this repo called cordova-plugin-firebasex It's been working great for me.对于那些仍然受此困扰的人,我建议使用这个 repo 的一个分支,称为cordova-plugin-firebasex它对我来说效果很好。
Be sure to read the instructions on that page, since there are several changes that need to be made to your app compatible.请务必阅读该页面上的说明,因为需要对您的应用程序兼容进行一些更改。
enI am also facing the issue of version conflict in my environment- In android platform我也面临我的环境中的版本冲突问题-在android平台中
Below is my environment.下面是我的环境。
global packages:全局包:
@ionic/cli-utils : 1.2.0
Cordova CLI : 8.1.2 ([email protected])
Ionic CLI : 3.2.0
local packages:本地包:
@ionic/app-scripts : 3.2.3
@ionic/cli-plugin-cordova : 1.4.1
Cordova Platforms : android 7.1.4
Ionic Framework : ionic-angular 3.9.2
System:系统:
Node : v10.13.0
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
Please help!!请帮忙!!
None of the option is working没有一个选项有效
en我有同样的问题
en我有同样的错误,有人帮助我们。
enI still recommend the newer cordova-plugin-firebasex that I mention above.我仍然推荐我上面提到的较新的cordova-plugin-firebasex 。 You should also combine this with the cordova-plugin-androidx-adapter to handle these recent library differences.您还应该将它与cordova-plugin-androidx-adapter结合使用来处理这些最近的库差异。
EDIT: You should also install the cordova-plugin-androidx plugin (as recommend in the cordova-plugin-androidx-adapter documentation)编辑:您还应该安装cordova-plugin-androidx插件(如cordova-plugin-androidx-adapter 文档中推荐的那样)
After using these plugins, my projects no longer suffer from the issue mentioned in this thread.使用这些插件后,我的项目不再遇到此线程中提到的问题。
Be sure to read the documentation on these plugins!请务必阅读有关这些插件的文档!
enI got this message above:我在上面收到了这条消息:
cordova-plugin-androidx-adapter: Processed 8 Java source files in 192ms cordova-plugin-androidx-adapter:在 192 毫秒内处理了 8 个 Java 源文件
(config.widget.plugin || []).forEach is not a function (config.widget.plugin || []).forEach 不是函数
same issue here.同样的问题。
Failed to capture fingerprint of input files for task ': app:preDebugBuild ' property 'compileManifests' during up-to-date check.在最新检查期间未能捕获任务“: app:preDebugBuild ”属性“compileManifests”的输入文件的指纹。
enThe library com.google.android.库 com.google.android。 gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.1,17.2.1]], but resolves to 17.2.1. gms:play-services-measurement-base正在 [[17.0.0,17.0.0], [17.2.1,17.2.1]] 的各种其他图书馆请求,但解析为 17.2.1。 Disable the plugin and check your dependencies tree using ./gradlew : app:dependencies.禁用插件并使用 ./gradlew : app:dependencies 检查你的依赖树。
同样的问题请指教
enAny update on this?这事有进一步更新吗? I have the same problem我也有同样的问题
enx2
ar这怎么还是个问题?!
ensame issue here.同样的问题。
Failed to capture fingerprint of input files for task ': app:preDebugBuild ' property 'compileManifests' during up-to-date check.在最新检查期间未能捕获任务“: app:preDebugBuild ”属性“compileManifests”的输入文件的指纹。The library com.google.android.库 com.google.android。 gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.1,17.2.1]], but resolves to 17.2.1. gms:play-services-measurement-base正在 [[17.0.0,17.0.0], [17.2.1,17.2.1]] 的各种其他图书馆请求,但解析为 17.2.1。 Disable the plugin and check your dependencies tree using ./gradlew : app:dependencies.禁用插件并使用 ./gradlew : app:dependencies 检查你的依赖树。
Same issue here.这里同样的问题。 Does anyone found any solution.有没有人找到任何解决方案。 Please help.请帮忙。
enI'm commenting on this, because it was the first place I looked for this error and I may have found the answer on this thread:我正在对此发表评论,因为这是我查找此错误的第一个地方,并且我可能在此线程上找到了答案:
https://forum.ionicframework.com/t/android-build-falid-the-library-com-google-android-gms-play-services-measurement-base-is-being-requested-by-various-other-libraries/163390/21 https://forum.ionicframework.com/t/android-build-falid-the-library-com-google-android-gms-play-services-measurement-base-is-being-requested-by-various-other-图书馆/163390/21
which refers to another issue:这指的是另一个问题:
https://github.com/arnesson/cordova-plugin-firebase/issues/1057 https://github.com/arnesson/cordova-plugin-firebase/issues/1057
Basically the plugin cordova-plugin-firebase won't work, so it has to be removed, and then instead:基本上插件 cordova-plugin-firebase 不起作用,因此必须将其删除,然后改为:
ionic cordova plugin add [email protected] --save
I change the dependencies of the gradle file inside the folder platforms我更改文件夹平台内的gradle文件的依赖关系
folder > {project}/platforms/android/cordova-plugin-firebase/{projectname}-build.gradle文件夹 > {project}/platforms/android/cordova-plugin-firebase/{projectname}-build.gradle
// compile 'com.google. // 编译 'com.google. firebase:firebase-auth :+' this line firebase:firebase-auth :+' 这一行
compile 'com.google.编译'com.google。 firebase:firebase-auth :15.1.0'火力基地:火力基地认证:15.1.0'
and in the project properties file inside the folder:并在文件夹内的项目属性文件中:
{project}/platforms/android/project.properties {项目}/platforms/android/project.properties
cordova.system.library.2=com.google.android. cordova.system.library.2=com.google.android。 gms:play-services-tagmanager :15.0.2 gms:play-services-tagmanager :15.0.2
cordova.system.library.3=com.google. cordova.system.library.3=com.google。 firebase:firebase-core :15.0.2火力基地:火力基地核心:15.0.2
cordova.system.library.4=com.google. cordova.system.library.4=com.google。 firebase:firebase-messaging :15.0.2火力基地:火力基地消息:15.0.2
cordova.system.library.5=com.google. cordova.system.library.5=com.google。 firebase:firebase-config :15.0.2火力基地:火力基地配置:15.0.2
cordova.system.library.6=com.google. cordova.system.library.6=com.google。 firebase:firebase-perf :15.1.0火力基地:火力基地性能:15.1.0
I downgrade to that version, but just need to found that is required for your projects我降级到那个版本,但只需要找到你的项目所需要的
https://mvnrepository.com/artifact/com.google.android.gms/play-services-basement/17.0.0 https://mvnrepository.com/artifact/com.google.android.gms/play-services-basement/17.0.0
in that link you can found what is在那个链接中你可以找到什么是
cordova platform rm android科尔多瓦平台 rm android
cordova plugin rm cordova-plugin-firebase科尔多瓦插件rm科尔多瓦插件firebase
cordova plugin add cordova-plugin-firebasex科尔多瓦插件添加科尔多瓦插件firebasex
cordova plugin add cordova-plugin-androidx科尔多瓦插件添加科尔多瓦插件androidx
cordova plugin add cordova-plugin-androidx-adapter cordova 插件添加 cordova-plugin-androidx-adapter
cordova platform add android科尔多瓦平台添加android
Great!伟大的!
It worked for me,它对我有用,
cordova platform rm android科尔多瓦平台 rm android
cordova plugin rm cordova-plugin-firebase科尔多瓦插件rm科尔多瓦插件firebase
cordova plugin add cordova-plugin-firebasex科尔多瓦插件添加科尔多瓦插件firebasex
cordova plugin add cordova-plugin-androidx科尔多瓦插件添加科尔多瓦插件androidx
cordova plugin add cordova-plugin-androidx-adapter cordova 插件添加 cordova-plugin-androidx-adapter
cordova platform add android科尔多瓦平台添加android
worked for me为我工作
encordova platform rm android科尔多瓦平台 rm android
cordova plugin rm cordova-plugin-firebase科尔多瓦插件rm科尔多瓦插件firebase
cordova plugin add cordova-plugin-firebasex科尔多瓦插件添加科尔多瓦插件firebasex
cordova plugin add cordova-plugin-androidx科尔多瓦插件添加科尔多瓦插件androidx
cordova plugin add cordova-plugin-androidx-adapter cordova 插件添加 cordova-plugin-androidx-adapter
cordova platform add android科尔多瓦平台添加android
worked for me为我工作
en@wangdianyh : i tried above plugin but got new error|: @wangdianyh :我尝试了上面的插件,但出现了新错误|:
en(node:25393) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, copyfile '/Users/apple/Desktop/klino/klino_user/plugins/cordova-plugin-firebasex/src/android/colors.xml' (节点:25393)UnhandledPromiseRejectionWarning:错误:ENOENT:没有这样的文件或目录,复制文件'/Users/apple/Desktop/klino/klino_user/plugins/cordova-plugin-firebasex/src/android/colors.xml'
Use the firebasex plugin使用 firebasex 插件
cordova platform rm android科尔多瓦平台 rm android
cordova plugin rm cordova-plugin-firebase科尔多瓦插件rm科尔多瓦插件firebase
cordova plugin add cordova-plugin-firebasex科尔多瓦插件添加科尔多瓦插件firebasex
cordova plugin add cordova-plugin-androidx科尔多瓦插件添加科尔多瓦插件androidx
cordova plugin add cordova-plugin-androidx-adapter cordova 插件添加 cordova-plugin-androidx-adapter
cordova platform add android科尔多瓦平台添加android
And use the Sdk version 21并使用 SDK 版本 21
但我不确定这是否是 iOS 平台的解决方案。
enI faced the same issue and is resolved for my ionic app.我遇到了同样的问题,并为我的 ionic 应用程序解决了。 I am yet to check for IOS.我还没有检查IOS。 These are my steps.这些是我的步骤。
Removed existing:删除现有:
ionic cordova plugin remove cordova-plugin-firebase离子cordova插件删除cordova-plugin-firebase
npm uninstall @ionic-native/firebase npm卸载@ionic-native/firebase
Added new:新增:
npm install cordova-plugin-firebasex npm install cordova-plugin-firebasex
npm install cordova-plugin-firebase-core -- save npm install cordova-plugin-firebase-core -- 保存
npm install [email protected] npm install [email protected]
npm install [email protected] npm install [email protected]
Thanks,谢谢,
Ganesh加内什
cordova platform rm android科尔多瓦平台 rm android
cordova plugin rm cordova-plugin-firebase科尔多瓦插件rm科尔多瓦插件firebase
cordova plugin add cordova-plugin-firebasex科尔多瓦插件添加科尔多瓦插件firebasex
cordova plugin add cordova-plugin-androidx科尔多瓦插件添加科尔多瓦插件androidx
cordova plugin add cordova-plugin-androidx-adapter cordova 插件添加 cordova-plugin-androidx-adapter
cordova platform add android科尔多瓦平台添加android
worked for me为我工作
en
最有用的评论
I'm commenting on this, because it was the first place I looked for this error and I may have found the answer on this thread:我正在对此发表评论,因为这是我查找此错误的第一个地方,并且我可能在此线程上找到了答案:
https://forum.ionicframework.com/t/android-build-falid-the-library-com-google-android-gms-play-services-measurement-base-is-being-requested-by-various-other-libraries/163390/21 https://forum.ionicframework.com/t/android-build-falid-the-library-com-google-android-gms-play-services-measurement-base-is-being-requested-by-various-other-图书馆/163390/21
which refers to another issue:这指的是另一个问题:
https://github.com/arnesson/cordova-plugin-firebase/issues/1057 https://github.com/arnesson/cordova-plugin-firebase/issues/1057
Basically the plugin cordova-plugin-firebase won't work, so it has to be removed, and then instead:基本上插件 cordova-plugin-firebase 不起作用,因此必须将其删除,然后改为:
enionic cordova plugin add [email protected] --save