SunnyApp / flutter_contact

A flutter plugin for retrieving, creating, saving, and watching contacts on native devices
BSD 3-Clause "New" or "Revised" License
80 stars 62 forks source link

Migrate to V2 embedding #68

Open deepak786 opened 3 years ago

deepak786 commented 3 years ago

migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

tkeithblack commented 3 years ago

+1 I'm receiving the following warning with Flutter 2.5.0 using flutter_contact version: 0.9.1+7:

"The plugin flutter_contact uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration."

wish32 commented 3 years ago

+1 Good plugin! I'm facing the same problem...

deepak786 commented 2 years ago

@tkeithblack @wish32

I have submitted the PR (https://github.com/SunnyApp/flutter_contact/pull/69) which not only migrates to Android V2 embedding but also adds new features with some adjustments in the Plugin. Until the PR is not merged, you can use it in your projects.

Add or update the following in your pubspec.yml file.

dependency_overrides:
  flutter_contact:
    git:
      url: https://github.com/deepak786/flutter_contact
      ref: agendaboa_patch

Use it and share the feedback accordingly.

If you like the work, Don't hesitate to buy me coffee. Buy Me A Coffee

rabi-palmtree commented 2 years ago

+1 Hope this will be resolved soon

wangbo4020 commented 2 years ago
Running "flutter pub get" in Xxx...                   5.9s

The plugin `flutter_contact` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

Process finished with exit code 0

vernalclareai commented 2 years ago

Hi, any update to fix the warning? Thanks.

vernalclareai commented 2 years ago

I have another issue on this lib.

e: /Volumes/Data/Tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_contact-0.9.1+8/android/src/main/kotlin/co/sunnyapp/flutter_contact/FlutterContactFormsPlugin.kt: (85, 13): Smart cast to 'Activity' is impossible, because 'registrar.activity()' is a complex expression

if Anyone can know? Thanks.

deepak786 commented 2 years ago

@vernalclareai you can use this patch

dependency_overrides:
  flutter_contact:
    git:
      url: https://github.com/deepak786/flutter_contact
      ref: agendaboa_patch

It also resolved the above issue.

vernalclareai commented 2 years ago

okay, it could be resolved using the version. Thanks.