New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation in Android 11 stops the plugin from working #197
Comments
Same #196 |
and #204 I think |
@andrlange @ghenry my plate is full at the moment... can one of you submit a PR for this issue? |
Just reading https://www.simplifiedcoding.net/android-asynctask/ and looking how to replace it at https://github.com/lukasgit/flutter_contacts/blob/master/android/src/main/java/flutter/plugins/contactsservice/contactsservice/ContactsServicePlugin.java#L421 Not done this before, but will have a go. |
@andrlange which bits aren't working for you? I still see all contacts but can't use these:
but I they are not related to |
By switching on debug logging I even can't get the app build for Android anymore. I would recommend to transform the Android Java part to Kotlin so Kotlin Coroutines would replace Java Async Tasks. Most of the code should be translated quite simple because it's most work is mapping. |
@Faiyyazauxy could you look into this? |
Okay i will try to convert it and if done i will create a PR. Also as i can see the issue in the contact picker flow only. The contact list seems to work fine for android 11. Tested on pixel 4a. Update on the aboveHey guys, the issue is not related to asynctask. Yeah I know asynctask has been deprecated and we should move out of it but the core issue is with regard to privacy updates in android 11 for certain requirements. The contact add & edit falls into such categories. So there is a new requirement where we need to write a tag in manifest mentioning the permission for such special permission. Check out this link for more explaination : https://developer.android.com/training/package-visibility/use-cases Also check my staging PR, I have added the required tags and it is working fine for now. Asynctask conversion is a big task and right now even I am little busy with something. I will try to convert it if possible because we need to make it from start direct conversion will not work here. |
Any updates on fixing this? App keeps crashing when trying to get contacts from device. |
@Faiyyazauxy thanks for the update, which staging PR are you referring to? |
What are the manifest queries for contacts? I recently had to do this:
but presume the native code needs updating to check for these too as per https://developer.android.com/training/package-visibility/use-cases |
Going to test this now as I see there is a new release (0.6.1) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Due to the deprecation of AsyncTask on Android 11 the plugin is not working anymore
[deprecation] Registrar in PluginRegistry has been deprecated
[deprecation] AsyncTask()
[deprecation] executeOnExecutor
[deprecation] doInBackground
[deprecation] onPostExecute(Result)
The text was updated successfully, but these errors were encountered: