首页 文章

Unity - 没有在Android上调用Firebase函数

提问于
浏览
1

Just a month ago all the code bellow worked fine for me . 我可以简单地注册/登录并使用实时数据库,直到今天..我通常做了所有事情, created a new Unity Project ,将平台切换到 androidimported relevant Firebase SDKs 为统一,并复制下面的代码 which i used before without problems . 一切 ended with a successful build 在我的旧 LG G2 mini . 但有一点不同:

任何Firebase功能都没有被调用, no crash, no freezes, no errors shown in Unity Editor, just NOT BEING CALLED and all code which comes after it.

2周我试图解决这个问题,试图实时调试APK,但我一无所获 .

private void Awake()
{
    //Just an example to save typing in the login form
    UserNameInput.text = "demofirebase@gmail.com"; // everything works until this line:
    auth = FirebaseAuth.DefaultInstance; // this function is not being called and everything goes after it doesnt work too. 
    PasswordInput.text = "abcdefgh";

    // Set up the Editor before calling into the realtime database.
    FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://testproject-69c2c.firebaseio.com/");

    // Get the root reference location of the database.
    reference = FirebaseDatabase.DefaultInstance.RootReference;

    SignupButton.onClick.AddListener(() => Signup(UserNameInput.text, PasswordInput.text));
    LoginButton.onClick.AddListener(() => Login(UserNameInput.text, PasswordInput.text));
}

1 回答

  • 0

    好吧,我的4岁LG G2 Mini与Android Os 5.0.1似乎有问题 . 我刚刚在朋友的三星和iPhone 5上测试了一切 . 之后一切都在其他10000种不同的Android和iOs智能手机上运行良好 .

相关问题