Skip to content
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

ContactsServicePlugin.java uses or overrides a deprecated API #204

Closed
virajdoshi11 opened this issue Mar 20, 2021 · 7 comments
Closed

ContactsServicePlugin.java uses or overrides a deprecated API #204

virajdoshi11 opened this issue Mar 20, 2021 · 7 comments
Labels
wontfix This will not be worked on

Comments

@virajdoshi11
Copy link

I am using contacts_service version 0.4.6

The problem is when I created an apk for my project there was one warning stating that ContactsServicePlugin.java uses or overrides a deprecated API.
Also I was using permission_handler package and there was a similar warning for that as well.

My flutter version is 2.0.1 in stable channel

there is no minimal code to regenerate that error, I guess this happens with any project

@virajdoshi11
Copy link
Author

Did anyone solve this issue ? @lukasgit

@arjenfvellinga
Copy link

For me, it fails on the line if (intent.resolveActivity(context.getPackageManager()) != null) { in

    void startIntent(Intent intent, int request) {
      if (this.activityPluginBinding != null) {
        if (intent.resolveActivity(context.getPackageManager()) != null) {
          activityPluginBinding.getActivity().startActivityForResult(intent, request);
        } else {
          finishWithResult(FORM_COULD_NOT_BE_OPEN);
        }
      } else {
        context.startActivity(intent);
      }
    }

@lukasgit
Copy link
Owner

@virajdoshi11 @arjenfvellinga my plate is full at the moment... can either of you submit a PR for this issue?

@AntonyLeons
Copy link

@arjenfvellinga please provide example code as I have my apps running on android 11 and I view and add to the contacts in this app, please be aware contacts permission must be granted or errors will occur

@arjenfvellinga
Copy link

@AntonyLeons

I'm sure the contact permission is granted.

But the function I call is openExistingContact, so maybe view and add works, but edit don't on Android 11? There is no specific code to share other than:

  Future<void> edit(domain.Contact contact) async {
    _requestPermission(permission: Permission.contacts);

    await ContactsService.openExistingContact(contact.toThirdPartyEntity());
  }

@stale
Copy link

stale bot commented May 30, 2021

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.

@stale stale bot added the wontfix This will not be worked on label May 30, 2021
@stale stale bot closed this as completed Jun 6, 2021
@aktarulahsan
Copy link

my issue is
Note: /Users/app-dev/.pub-cache/hosted/pub.dev/contacts_service-0.6.3/android/src/main/java/flutter/plugins/contactsservice/contactsservice/ContactsServicePlugin.java uses or overrides a deprecated API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants