离子错误:无法安装"cordova-plugin-firebase":错误:嗯-安装时 [英] Ionic error : Failed to install 'cordova-plugin-firebase': Error: Uh oh - while installing
问题描述
我刚刚创建了一个新的离子项目,并尝试将Firebase native与之集成,但无法正常工作.有人可以帮我吗?
I just created a new ionic project and tried to integrate firebase native with it, its not working. Can someone please help me with this.
C:\Users\goura\Desktop\Ioninc\test>ionic cordova plugin add cordova-plugin-firebase
> cordova.cmd plugin add cordova-plugin-firebase
Installing "cordova-plugin-firebase" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-firebase': Error: Uh oh!
EPERM: operation not permitted, unlink 'C:\Users\goura\Desktop\Ioninc\test\platforms\android\app\src\main'
at Object.unlinkSync (fs.js:1136:3)
at mayCopyFile (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:59:8)
at onFile (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:54:10)
at getStats (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:48:44)
at startCopy (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:38:10)
at handleFilterAndCopy (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:33:10)
at Object.copySync (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:26:10)
at copyFile (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\lib\pluginHandlers.js:223:12)
at install (C:\Users\goura\Desktop\Ioninc\test\platforms\android\cordova\lib\pluginHandlers.js:61:13)
安装版本节点-v12.18.3npm-6.14.6离子性的-5.4.16科尔多瓦-10.0.0@ ionic-native/firebase-5.28.0cordova-plugin-firebase-2.0.5
Versions of installations node - v12.18.3 npm - 6.14.6 ionic - 5.4.16 cordova - 10.0.0 @ionic-native/firebase - 5.28.0 cordova-plugin-firebase - 2.0.5
等级-7Java-8.1
Gradle - 7 Java - 8.1
我也尝试过FCM,它给出了一些注释错误.
I tried FCM as well it was giving some annotations error.
推荐答案
我遇到了同样的问题.我发现的唯一解决方案是在添加android平台之前创建另一个项目并添加插件.
I had the same issue. The only solution i've found was create another project and add plugin before adding android platform.
另一种可能的解决方案(我尚未测试)是,在原始项目中,将此行包含在config.xml中:
Another possible solution (i haven't test yet) is, in original project, include this line in config.xml:
<plugin name="cordova-plugin-firebase" spec="^2.0.0" />
或在终端中运行:
cordova plugin add cordova-plugin-firebase --save
,然后重建您的apk.来源: https://www.npmjs.com/package/cordova-plugin-firebase
(插件官方支持)
and then rebuild your apk.
Source: https://www.npmjs.com/package/cordova-plugin-firebase
(plugin official support)
让我知道是否可行.
我已经测试了第二个选项(在 config中包含< plugin name ="cordova-plugin-firebase" spec =" ^ 2.0.0&"/>
.xml ),它对我有用.只记得在之后重建您的apk.
I've test the second option (include <plugin name="cordova-plugin-firebase" spec="^2.0.0" />
in config.xml) and it works for me.
Just remember rebuild your apk after.
这篇关于离子错误:无法安装"cordova-plugin-firebase":错误:嗯-安装时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!