Android Question Android 11 error writing contacts: java.lang.SecurityException

walt61

Active Member
Licensed User
Longtime User
I'm puzzled. When writing contacts (trying to make any kind of modifications to contacts data) I'm getting the below error; the code works fine on Android 7, but not on my new toy with Android 11 (Xiaomi Redmi Note 10), B4A 10.90:


RuntimePermissions PERMISSION_READ_CONTACTS and PERMISSION_WRITE_CONTACTS have been requested and granted, and the Manifest contains AddPermission lines for both. The error occurs in wmContactUtils.InsertContact, at line 457:
B4X:
Dim rawUri As Uri = cr.Insert(rawContactUri, values)
Any hints would be greatly appreciated as I'm clueless... The attached test project contains one external library: Clipboard, to copy the StackTrace to the clipboard. This library can be found at https://www.b4x.com/android/forum/threads/clipboard-library.7382/

Thanks in advance!
 

Attachments

  • ContactsError.zip
    26.4 KB · Views: 220
Cookies are required to use this site. You must accept them to continue using the site. Learn more…