App not running on Android 8

I have an ionic app that it worked fine until Android 7, but with Android 8 I get an error on first screen and I can lauch the app.

This is the error: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{90ce8a3 6461:com.ionicframework.mobile860711/u0a85} (pid=6461, uid=10085) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:67)

But I don’t use these permissions, and even if i put the permissions on AndroidManifest.xml it’s still not working.

Someone can help me?

1 Like

If you put these perms, does you have any output logs (like error?)
And does the app running on other Android versions? (using Android Studio for example?)

Hi Izio38.

Yes I have the same error, and the app is running ok on previous versions without problems, android 7, 6, 5 even 4.

You use "ContactsProvider2 " somewhere according to the logs.
And maybe you misswrote the permission?

No ContactProvider is’nt used at this app, even READ_CONTACTS and WRITE_CONTACTS permissions weren’t on the Manifest i only put there beacuse this error, this app don’t use contacts.

If they were used this app would fail on previous versions too. That’s isa very weird situation.

Not really, because Oreo made some fundamental changes to the permission system. This bit me on the Camera plugin, and perhaps your siituation is similar. Look into using the android-permissions plugin.

But i dont need permissions because i don’t use contacts on this app, so i don’t understand why is asking me for permissions and failing.

I only have a login, but this login is with an API.

What does your package.json look like?

My guess at this point is that you have a plugin that requests those permissions.

I have the exactly same situation, have been struggling in this for days, please help.

App is running without problems on android 7 and earlier versions, but with android 8 the app crashes as soon as the app is launched. In Logcat shows the same error: Permission Denial: opening provider … requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS.

I have Cordova 8.0.0 and Cordova Android 6.3.0, I firstly thought it’s because the Cordova Android version is outdated, upgraded it to Cordova Android 7.1.0 (broke a lot of things, took me very long time to fix the compatibility issues), but still, the same error as above.
I have reverted back to Android 6.3.0, since I’m not totally sure if the fix I made for the compatibility issues won’t break anything else.

I’m out of ideas, please anyone help

Hi @Amador75 , have you managed to solve the issue?

2 Likes

Hi,

I have just hit the same issue due to the google store demanding you increase the targetsdk,.

Did anyone resolve this?