Android Question BLE2 forum example error [Solved]

roerGarcia

Active Member
Licensed User
Longtime User
From https://www.b4x.com/android/forum/threads/ble-2-bluetooth-low-energy.59937/

I took the example from the forum and compiled it, when running it sends this diagnosis.

Does it have to do with the version of the SDK installed?

Message Error:
Registro conectado a:  motorola Moto G (4)
--------- beginning of crash
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/content/ContextCompat;
    at anywheresoftware.b4a.objects.RuntimePermissions.Check(RuntimePermissions.java:73)
    at anywheresoftware.b4a.objects.RuntimePermissions.CheckAndRequest(RuntimePermissions.java:97)
    at b4a.bbb.main$ResumableSub_btnScan_Click.resume(main.java:526)
    at b4a.bbb.main._btnscan_click(main.java:502)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
    at android.view.View.performClick(View.java:5612)
    at android.view.View$PerformClick.run(View.java:22285)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6123)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.ContextCompat" on path: DexPathList[[zip file "/data/app/b4a.bbb-1/base.apk"],nativeLibraryDirectories=[/data/app/b4a.bbb-1/lib/arm, /system/lib, /vendor/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 22 more
 

josejad

Expert
Licensed User
Longtime User
Yes, probably a SDK problem. Follow carefully the setup instructions

Same error, and Erel's answer about it
 
Upvote 0

roerGarcia

Active Member
Licensed User
Longtime User
Ok, thanks.
Updating.

The program runs without errors. It does not locate devices yet, I am reviewing why.

[Google translation]
 
Last edited:
Upvote 0
Top