DRSchlaubi / contact_picker

A Flutter plugin for picking a contact from the address book.
https://pub.dev/packages/fluttercontactpicker
BSD 3-Clause "New" or "Revised" License
18 stars 37 forks source link

Kotlin Experimental Feature Issue #38

Closed ebitogu closed 3 years ago

ebitogu commented 3 years ago

Hello, thanks for the time taken to make this amazing library.

However, I couldn't get it to work.

This is what I keep getting:

e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\fluttercontactpicker-4.5.0\android\src\main\kotlin\me\schlaubi\fluttercontactpicker\ContactPicker.kt: (22, 115): This declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'

DRSchlaubi commented 3 years ago

I can't reporduce this with flutter build can you tell me which command you used

DRSchlaubi commented 3 years ago

Fixed in 4.5.1

DRSchlaubi commented 3 years ago

Whoops wrong issue

ebitogu commented 3 years ago

I used this command

flutter run lib/main.dart --no-sound-null-safety

Here is my android config

defaultConfig{
 minSdkVersion 20
 targetSdkVersion 30
}
robert-virkus commented 3 years ago

I have the same breaking issue, downgrading to 4.4.0 and flutter clean fixed it for me:

  fluttercontactpicker: 4.4.0
DRSchlaubi commented 3 years ago

I have the same breaking issue, downgrading to 4.4.0 and flutter clean fixed it for me:

  fluttercontactpicker: 4.4.0

But 4.4.0 is not supported anymore and shouldn't be used

My guess is that you havea kotlin version before 1.5 in your app in which that function is marked as experimental so make sure to use kotlin 1.5 as well

robert-virkus commented 3 years ago

Thanks for your feedback!

Indeed my previous kotlin-version was 1.4.31 in android/build.gradle, upgrading to 1.5.0 fixed the problem.

buildscript {
    ext.kotlin_version = '1.5.0'
   [...]
}

Currently the fluttercontractpicker documentation states: "Note: This plugin requires at least Kotlin 1.4.0 to compile". It would be nice to update this requirement and also specify how to do it.

ebitogu commented 3 years ago

Thanks @DRSchlaubi, increasing my kotlin version to 1.5 fixed it.

DRSchlaubi commented 3 years ago

Thanks for your feedback!

Indeed my previous kotlin-version was 1.4.31 in android/build.gradle, upgrading to 1.5.0 fixed the problem.

buildscript {
    ext.kotlin_version = '1.5.0'
   [...]
}

Currently the fluttercontractpicker documentation states: "Note: This plugin requires at least Kotlin 1.4.0 to compile". It would be nice to update this requirement and also specify how to do it.

The readme got updated in https://github.com/DRSchlaubi/contact_picker/commit/6d7169f98d8148131e372a03eab34fe3c0083ecf