SunnyApp / flutter_contact

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

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/OffsetDateTime #3

Closed fedotxxl closed 4 years ago

fedotxxl commented 4 years ago

Is this plugin require minSdkVersion 26? Can you make it compatible with minSdkVersion 21?

E/AndroidRuntime(30313): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/OffsetDateTime;
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.Contact.<init>(Contact.kt:33)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.Contact.<init>(Contact.kt:45)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.Resolver_extensionsKt.toContactList(resolver-extensions.kt:79)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.FlutterContactPlugin.getContacts(FlutterContactPlugin.kt:112)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.FlutterContactPlugin.access$getContacts(FlutterContactPlugin.kt:29)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.FlutterContactPlugin$onMethodCall$1.invoke(FlutterContactPlugin.kt:44)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.FlutterContactPlugin$onMethodCall$1.invoke(FlutterContactPlugin.kt:29)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.PluginStubsKt$asyncTask$task$1.doInBackground(PluginStubs.kt:12)
E/AndroidRuntime(30313):    at co.sunnyapp.flutter_contact.PluginStubsKt$asyncTask$task$1.doInBackground(PluginStubs.kt:9)
E/AndroidRuntime(30313):    at android.os.AsyncTask$2.call(AsyncTask.java:305)
E/AndroidRuntime(30313):    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/AndroidRuntime(30313):    ... 4 more
E/AndroidRuntime(30313): Caused by: java.lang.ClassNotFoundException: Didn't find class "java.time.OffsetDateTime" on path: DexPathList[[zip file "/data/app/io.thedocs.android.chatChecklist-2/base.apk"],nativeLibraryDirectories=[/data/app/io.thedocs.android.chatChecklist-2/lib/arm64, /data/app/io.thedocs.android.chatChecklist-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
E/AndroidRuntime(30313):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime(30313):    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
E/AndroidRuntime(30313):    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
SamiKouatli commented 4 years ago

Same error here, with sdkVersion 24. Any solutions ?

SamiKouatli commented 4 years ago

@fedotxxl I created a pull request #9 to fix this.

ericmartineau commented 4 years ago

I merged a PR that downgraded OffsetDateTime to java.util.Date. This should be fixed