离子错误:无法安装“ cordova-plugin-firebase”:错误:哦哦-安装时

时间:2020-08-17 10:50:17

标签: android firebase cordova ionic-framework ionic-native

我刚刚创建了一个新的离子项目,并试图将Firebase native与之集成,但无法正常工作。有人可以帮我吗?

import pickle
import time


class GUI():
    

   
        
    def __init__(self, visitors):
         self.visitors = visitors
         self.rest = 15-int(self.visitors)
         print("bin hier")
         self.window = Tk()
         self.pzahlvar= StringVar(value="{0}/15".format(self.visitors))
         self.restvar = StringVar(value="Es können noch {0} Gäste eintreten".format(self.rest))
         self.ueberschrift = Label(self.window, text="Aktuelle Badegäste:", font=("Arial bold", 72)).pack(pady=50)
         self.personenzahl = Label(self.window, textvariable=self.pzahlvar, font=("Arial bold", 150))
         self.personenzahl.pack(pady=90)
         if self.rest>0:
                self.restgaeste = Label(self.window, textvariable=self.restvar, font=("Arial bold", 65))
         else:
                self.restgaeste = Label(self.window, text="Die maximale Gästezahl ist erreicht. Aktuell kein Eintritt".format(rest), font=("Arial bold", 72))
                self.window.bg("red")
         self.restgaeste.pack(pady=100)
         self.setPLabel()
         self.window.mainloop()
 
    def setPLabel(self):
        self.personenzahl = Label(self.window, textvariable=self.pzahlvar, font=("Arial bold", 150))
        self.personenzahl.after(1000, setPLabel)
        
    def setPzahlVar(self, zahl):
        self.pzahlvar.value="{0}/15".format(zahl)```

安装版本 节点-v12.18.3 npm-6.14.6 离子性的-5.4.16 科尔多瓦-10.0.0 @ ionic-native / firebase-5.28.0 cordova-plugin-firebase-2.0.5

等级-7 Java-8.1

我也尝试过FCM,它给出了一些注释错误。

1 个答案:

答案 0 :(得分:0)

我有同样的问题。我发现的唯一解决方案是在添加android平台之前创建另一个项目并添加插件。

另一种可能的解决方案(我尚未测试)是,在原始项目中,将此行包含在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
(插件官方支持)

让我知道是否可行。

更新

我已经测试了第二个选项(在 config.xml 中包括<plugin name="cordova-plugin-firebase" spec="^2.0.0" />),它对我有用。 只记得在之后重建您的apk。