Console log not fired in promise when run on android device

I’m trying to get devices contact list. When run app on browser I can see the logs in promise, when run on device I can’t see the logs. I’m running the app on android 5.1 and use chrome inspect device to see the logs.

public loadContactsFromDevice(): void {
    console.log('ContactsProvider loadContactsFromDevice INIZIO');//this is fired
    this.contacts.find(
      ['displayName', 'name', 'birthday'],
      {filter: "", multiple: true})
      .then(resultData => {
        console.log('ContactsProvider loadContactsFromDevice resultData:' +resultData);//this is not fired

        this.allContacts = resultData;//this is fired

        this.setContactsList(this.allContacts);//this is fired

      })
      .catch(err => console.error("Error loading my data", err));
    console.log('ContactsProvider loadContactsFromDevice FINE');//this is fired
  }

This is probably a really stupid question, but when you’re running on device are you building with --prod? If so, I believe that NOPs console logs.

rapropos I’m running

ionic cordova run android --debug

and only the logs inside .then(…){} are not fired. The other logs are fired.

I found the solution: the call on the method with the logs in promise was in the app.component.ts inside

platform.ready().then(){}

I put it outside the platform ready and now I can see the logs. I don’t understand why but it works.