Android Question After Update to B4A 9.50 library can't work anymore?

evbedp

Member
Licensed User
Longtime User
Dear All,
i need some help, i have created library from android studio to b4a library when my b4a version 8 is work fine and don't have problem. after i'm upgrade my b4a version 8 to b4a 9.50, my library can't run anymore and show error like this :
B4X:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/doku/sdkocov2/BaseSDKOCO;
    at com.doku.sdkocov2.DirectSDK.getResponse(DirectSDK.java:110)
    at com.kliktobuy.dokusdk.DokuSDK.connectSDK(DokuSDK.java:182)
    at com.kliktobuy.dokusdk.DokuSDK.StartPayment(DokuSDK.java:162)
    at com.kliktobuy.build.customer.activitycheckoutfinish._activity_resume(activitycheckoutfinish.java:631)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at com.kliktobuy.build.customer.activitycheckoutfinish.afterFirstLayout(activitycheckoutfinish.java:110)
    at com.kliktobuy.build.customer.activitycheckoutfinish.access$000(activitycheckoutfinish.java:17)
    at com.kliktobuy.build.customer.activitycheckoutfinish$WaitForLayout.run(activitycheckoutfinish.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5942)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.doku.sdkocov2.BaseSDKOCO" on path: DexPathList[[zip file "/data/app/com.kliktobuy.build.customer-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 24 more
    Suppressed: java.lang.NoClassDefFoundError: com.doku.sdkocov2.BaseSDKOCO
        at dalvik.system.DexFile.defineClassNative(Native Method)
        at dalvik.system.DexFile.defineClass(DexFile.java:226)
        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
        at dalvik.system.DexPathList.findClass(DexPathList.java:321)
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
        ... 26 more
    Suppressed: java.lang.ClassNotFoundException: com.doku.sdkocov2.BaseSDKOCO
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 25 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

please help me, i have run jetifier for library that I have made. but i can't run jetifier for AAR file (SDK from vendor), jetifier give me message like this :

upload_2019-10-23_13-33-30.png
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Moved to the questions forum.

You are confusing different things. AndroidX and B4A v9.50 are not strictly related. You can use the old Android Support library with B4A v9.50.

android-support-v4.jar should be deleted as it is not used for several years.

About sdkocov2.0.2.aar:
Try to delete the two listed files from the aar and jetify it again.
 
Upvote 0

evbedp

Member
Licensed User
Longtime User
i'm still got this error

B4X:
ava.lang.NoClassDefFoundError: Failed resolution of: Lcom/doku/sdkocov2/BaseSDKOCO;
    at com.doku.sdkocov2.DirectSDK.getResponse(DirectSDK.java:110)
    at com.kliktobuy.dokusdk.DokuSDK.connectSDK(DokuSDK.java:182)
    at com.kliktobuy.dokusdk.DokuSDK.StartPayment(DokuSDK.java:162)
    at com.kliktobuy.build.customer.activitycheckoutfinish._activity_resume(activitycheckoutfinish.java:631)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at com.kliktobuy.build.customer.activitycheckoutfinish.afterFirstLayout(activitycheckoutfinish.java:110)
    at com.kliktobuy.build.customer.activitycheckoutfinish.access$000(activitycheckoutfinish.java:17)
    at com.kliktobuy.build.customer.activitycheckoutfinish$WaitForLayout.run(activitycheckoutfinish.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5942)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.doku.sdkocov2.BaseSDKOCO" on path: DexPathList[[zip file "/data/app/com.kliktobuy.build.customer-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 24 more
    Suppressed: java.lang.NoClassDefFoundError: com.doku.sdkocov2.BaseSDKOCO
        at dalvik.system.DexFile.defineClassNative(Native Method)
        at dalvik.system.DexFile.defineClass(DexFile.java:226)
        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
        at dalvik.system.DexPathList.findClass(DexPathList.java:321)
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
        ... 26 more
    Suppressed: java.lang.ClassNotFoundException: com.doku.sdkocov2.BaseSDKOCO
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 25 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
 
Upvote 0

evbedp

Member
Licensed User
Longtime User
after change to older verion of ANDROID SDK. i'm can't use recyclerVIEW

B4A Version: 9.50
Java Version: 8
Parsing code. (0.52s)
Building folders structure. (0.02s)
Compiling code. (0.95s)
Compiling layouts code. (0.04s)
Organizing libraries. (0.00s)
(Android Support Library)
Generating R file. (1.03s)
Compiling debugger engine code. (6.15s)
Compiling generated Java code. Error
B4A line: 277
HeaderAdapter.Initialize(Adapter)
javac 1.8.0_162
src\com\kliktobuy\build\customer\main.java:935: error: package androidx.recyclerview.widget.RecyclerView does not exist
parent.mostCurrent._headeradapter.Initialize((androidx.recyclerview.widget.RecyclerView.Adapter)(_adapter.getObject()));
 
Upvote 0

evbedp

Member
Licensed User
Longtime User
Upvote 0

evbedp

Member
Licensed User
Longtime User
The latest version of RecyclerView depends on AndroidX. You should download an older version.

BTW, it might be easier to fix your library and make it compatible with AndroidX. There are very few cases where it is not possible.

the problem is AAR Library is not from me, that's develop from the other company. so i can't make it compatible.
the AAR file have Layouts using APPCOMPAT. i can't jetifier it because of signature on the AAR File.
 
Upvote 0
Top