title: Firebase initialisation exception with Unity Android
body: <p>We are developing an application in unity with the aim to deploy to android and are using firebase to facilitate user login and real time database. </p>
  
  <p>We are using the real time database to store the location and information about specific objects and synchronize them across all players. The database also stores the individual data about each user. Our implementation has a single parent object called <code>GenericInterface</code> which has all of the shared code between the <code>PlayerInterface</code> and <code>BuildingInterface</code> which extend <code>GenericInterface</code>.</p>
  
  <p><code>GenericInterface</code> has the initialization code for our firebase implemention:</p>
  
  <pre><code>Auth = FirebaseAuth.DefaultInstance;
  // Set this before calling into the realtime database.
  FirebaseApp.DefaultInstance.SetEditorDatabaseUrl(/*DB Url*/);
  
  //set up restricted access. 
  // Set these values before calling into the realtime database.
  FirebaseApp.DefaultInstance.SetEditorP12FileName(/* P12 filename */);
  
  FirebaseApp.DefaultInstance.SetEditorServiceAccountEmail(/*AccountEmail*/);
  FirebaseApp.DefaultInstance.SetEditorP12Password(/*Password*/);
  
  // Get the root reference location of the database
  Reference = FirebaseDatabase.DefaultInstance.RootReference;
  </code></pre>
  
  <p>This <code>Reference</code> is then used by <code>PlayerInterface</code> and <code>BuildingInterface</code> to load data through listeners, for example in the <code>PlayerInterface</code>: </p>
  
  <pre><code>var path = string.Format("players/{0}", pid);
  Reference = FirebaseDatabase.DefaultInstance.GetReference(path);  
  Reference.ValueChanged += HandleValueChanged;
  </code></pre>
  
  <p>Where pid is the player's Id.</p>
  
  <p>The project (apart from player login) works as intended when launched and run in the unity editor with buildings being fetched and displayed correctly by the <code>BuildingInterface</code>. However when building and running on either an AVD or Android Phone, none are displayed and a <code>adb.exe logcat -s Unity</code> shows the following error:</p>
  
  <pre><code>DBInterfaces.Abstract.GenericInterface`1:_start() (at [...]\Assets\Scripts\Firebase\Interfaces\Abstract\GenericInterface.cs:24)
  DBInterfaces.Abstract.GenericInterface`1:.ctor() (at [...]\Assets\Scripts\Firebase\Interfaces\Abstract\GenericInterface.cs:18)
  DBInterfaces.BuildingInterface:.ctor() (at E:\Users\Documen
  InitializationException: Exception of type 'Firebase.InitializationException' was thrown.
      at Firebase.Auth.FirebaseAuth+&lt;GetAuth&gt;c__AnonStorey1.&lt;&gt;m__0 () [0x00000] in &lt;filename unknown&gt;:0
      at Firebase.FirebaseApp.TranslateDllNotFoundException (System.Action closureToExecute) [0x00000] in &lt;filename unknown&gt;:0
  </code></pre>
  
  <p>[Trimmed long file path for clarity]</p>
  
  <p>Line 24 of <code>GenericInterface</code> Corresponds to <code>Auth = FirebaseAuth.DefaultInstance;</code></p>
  
  <p>We have been working on this for the better part of the week and haven't found any potential solutions.</p>