Skip to content

Use realtime database Emulator from Unity #1218

Open
@DiscoverTravel

Description

@DiscoverTravel

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.25f1
  • Firebase Unity SDK version: 8.7.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Database (Auth, Database, etc.)
  • Other Firebase Components in use: Database, Auth, Config (Auth, Database, etc.)
  • Additional SDKs you are using: _____ (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: Emulator (desktop) (iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)

[REQUIRED] Please describe the issue here:

Unity crash if use local instance of Database (Emulator)
In unity crash log:
ERROR: Could not initialize persistence: Unable to find app data directory.
Crash !!!

Steps to reproduce:

Use this code to connect to the emulator

Relevant Code:

FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(async task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                FirebaseDatabase db = Firebase.Database.FirebaseDatabase.GetInstance("http://localhost:9000/?ns=myns");
                var snapshot = await db.GetReference("test").GetValueAsync();
                Debug.Log("The value: " + snapshot.Value);
            }
        });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions