Error throwed by nativescript-contacts


I try use this plugins:
I have this code to add contact to contact list:

const newContact = new contacts.Contact(); = "test"; = "petr"; = "danek"
        newContact.phoneNumbers.push({ label: contacts.KnownLabel.HOME, value: "777666888" });
        try {
        } catch (e) {

I test it on android emulator but I got error:
“originalStack”: "Error: No Accounts!\n at ZoneAwareError (file:///data/data/org.nativescript.SkautISmobile/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:994:
33)\n at (file:///data/data/org.nativescript.SkautISmobile/files/app/tns_modules/nativescript-contacts/contact-model.js:259:19)\n throwed in line with

What I have wrong. It could be according to docs.


You haven’t created a account yet, login with Google as you would do in real device if play services are installed or create a dummy account.


Thanks for answer,
Can you describe it more detailed?
I think that i am login in emulator with my gmail. Because I see some contacts from gmail in contacts app. For example if i open google play store, I am login there.
Or how i should login create dummy account?


That sounds like you already have the accounts in place but did you acquire the permissions?


Yea, thanks for tips.
I add permission and request permission. But now after call; I get Error:
“Error: No Accounts!
at ZoneAwareError (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:994:33)
at (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-contacts/contact-model.js:259:19)
at file:///data/data/org.nativescript.testapp/files/app/services/shared/phone-contact.service.js:107:24
at ZoneDelegate.invoke (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:365:26)
at Object.onInvoke (file:///data/data/org.nativescript.SkautISmobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:4787:33)
at ZoneDelegate.invoke (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:364:32)
at (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:125:43)
at file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:761:57
at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:398:31)
at Object.onInvokeTask (file:///data/data/org.nativescript.testapp/files/app/tns_modules/@angular/core/bundles/core.umd.js:4778:33)
at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:397:36)
at Zone.runTask (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:165:47)
at drainMicroTaskQueue (file:///data/data/org.nativescript.testapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:593:35)”
My code now looks like this:

Permissions.requestPermissions([android.Manifest.permission.GET_ACCOUNTS, android.Manifest.permission.WRITE_CONTACTS], "This permissions are required for save contact to mobil contacts.")
            .then(() => {
            }).catch(e => {

I find same error on git:, but there is only solution in node_modules code, what is not best solution. What is wrong? I have to somehow add accounts? but if i open contacts app there is about 20 contact from my gmail. Thanks


I found this to be a common error on new Android emulators. On the emulator, log into Google, and separately, create at least one contact. See if that helps.


Thanks for tips, but not help it
I go to contacts in emulator i was under my gmail and create new contact. I see it in contacts, but If I want create new cotnact using plugin I get same error: No account.

But if it is only emulator problem, its ok