Firebase firestore working on emulator but not on real device



Hi I have trouble testing the Firebase plugin.

When I test on the computer using the Android Simulator (image Motorola G3 Android 6.0) it works perfectly. But on a real device (Motorola G3 Android 6.0) It can’t get any collections.

It does not throws any errors. It’s like is not data on the database but you can clearly see all the data on the web and on the simulator.


Did you get any error while performing the authentication call on real device (assuming your Firestore DB data is not public)?


Hi @manojdcoder thanks for your reply.

I did not receive any error during the init call

var firebase = require("nativescript-plugin-firebase");

  // Optionally pass in properties for database, authentication and cloud messaging,
  // see their respective docs.
    function (instance) {
      console.log("firebase.init done");
    function (error) {
      console.log("firebase.init error: " + error);

This is the init code that works ok on both sides. But later on the app when I call a collection, it only works on the simulator.


I didn’t mean the init call. I was referring to authenticate call until your data in the tables are public.


Hi, my data for now is public.


Quick update.

I created an empty project using the Vue CLI Template Then installed the NativeScript-Plugin-Firebase following the instructions:

  1. Download the google-services.json
  2. Using npm install nativescript-plugin-firebase instead of tns, because I am using NS-Vue.
  3. Running npm run clean to erase any cache.
  4. Create a copy of the file firebase.nativescript.json to the template folder.
  5. Add the multiDexEnabled true on the app.gradle in the template/app/App_Resources/Android folder.

Then run a simple query in HelloWorld.vue like this:

    <ActionBar title="Hello world">
      <Label v-for="(item, index) in collection" :key="index">


const firebase = require("nativescript-plugin-firebase/app");

export default {
  data() {
    return {
      collection: [],
      surprise: false
  mounted() {
      .then(querySnapshot => {
        querySnapshot.forEach(doc => {
          console.log(`${} => ${JSON.stringify(}`);

On the device this works displaying a food menu but it does not work on the device.

I am using the Firebase plugin on version 6.4.0.


Sorry I’m quite confused, what you mean by that?


Hi, sorry for the confussion.

What I meant is that I created a quick test array in FireStore with a route like this:


We’re I put some documents representing items in a food menu.

But it does not show in the device.


This is what I meant. Same code and same database running from the simulator and the device.

The database is public.


Did you try running the demo app from the plugin repo on your device, did that work as expected?


Hi I will try that and report back.


Hi, the firebase demo app works. That app is using pure Nativescript and NS-Angular.
Does NS-Vue have a recent problem with Firebase because I was able to use NS-Vue with Firebase just fine a few weeks ago.


NativeScript Core or Angular or Vue, end of the day everything is just JavaScript. Vue alone should not cause any trouble with services like Firebase.

You may be missing something in your local or firebase setup, try to double check. Try replacing your firebase app config in the demo app, see whether you get expected output.


Just right now I am trying to debug it. I will try your idea and report back.