andrey-ushakov / flutter_bluetooth_basic

Flutter plugin. Allows to find bluetooth devices & send raw bytes data
BSD 3-Clause "New" or "Revised" License
39 stars 141 forks source link

java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.ContextCompat" on path: DexPathList #2

Closed DmitrySikorsky closed 4 years ago

DmitrySikorsky commented 4 years ago

Hi, after upgrading Flutter I receive this exception when trying to discover Bluetooth devices:

[ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/content/ContextCompat; E/flutter (18058): at com.tablemi.flutter_bluetooth_basic.FlutterBluetoothBasicPlugin.onMethodCall(FlutterBluetoothBasicPlugin.java:92) E/flutter (18058): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231) E/flutter (18058): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93) E/flutter (18058): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642) E/flutter (18058): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter (18058): at android.os.MessageQueue.next(MessageQueue.java:325) E/flutter (18058): at android.os.Looper.loop(Looper.java:142) E/flutter (18058): at android.app.ActivityThread.main(ActivityThread.java:6518) E/flutter (18058): at java.lang.reflect.Method.invoke(Native Method) E/flutter (18058): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) E/flutter (18058): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) E/flutter (18058): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.ContextCompat" on path: DexPathList

• Flutter version 1.12.13+hotfix.8 at C:\Flutter • Framework revision 0b8abb4724 (3 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0

DmitrySikorsky commented 4 years ago

Fixed by moving to AndroidX.

andrey-ushakov commented 4 years ago

Hi @DmitrySikorsky ,

Thank you for your feedback.

Does this plugin work as expected for you under Android X? Are you able to find any Bluetooth devices?

DmitrySikorsky commented 4 years ago

Yes, it works fine.