Android Question widget ViewDragHelper error

luke2012

Well-Known Member
Licensed User
Longtime User
Hi All,
I'm trying to compile a old project after switch to AndroidX within B4A 9.30 but I got the error: "Failed resolution of: Landroid/support/v4/widget/ViewDragHelper$Callback".

I moved the android-support library from internal libraries to additional libraries folder.
I jetify it but this not resolve the error :-(

Any Idea about it?

Thanks in advance.
Luca.
 

DonManfred

Expert
Licensed User
Longtime User
I moved the android-support library from internal libraries to additional libraries folder.
??? What file you are talking about?
android-support-v4.jar? I´m positive that it is a mistake to have that file at all.

You (and all libraries) schould use maven artifacts instead of referencing a old, deprecated!, android-support-v4.jar
remove that file and instead add a dependency to com.android.support:support-v4
B4X:
#additionaljar: com.android.support:support-v4
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
??? What file you are talking about?
android-support-v4.jar? I´m positive that it is a mistake to have that file at all.

You (and all libraries) schould use maven artifacts instead of referencing a old, deprecated!, android-support-v4.jar
remove that file and instead add a dependency to com.android.support:support-v4
B4X:
#additionaljar: com.android.support:support-v4

Hi @DonManfred. Thanks for your suggestion.

I removed the file android-support-v4.jar from internal and additonal libraries folders and I added the #additionaljar as you suggested:

B4X:
#additionaljar: com.android.support:support-v4

But don't resolve. I got the same error during the app startup :-( See the log:

B4X:
Logger connesso a:  HUAWEI LLD-L31
--------- beginning of system
--------- beginning of crash
--------- beginning of main
Copying updated assets files (138)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/widget/ViewDragHelper$Callback;
    at de.amberhome.navdrawer.NavigationDrawer.Initialize2(NavigationDrawer.java:84)
    at de.amberhome.navdrawer.NavigationDrawer.Initialize(NavigationDrawer.java:63)
    at yoursclbizluca.android.orderdrone_bagnomaeba.actiondrawer._initialize(actiondrawer.java:907)
    at yoursclbizluca.android.orderdrone_bagnomaeba.actiondrawerbuilder._initialize(actiondrawerbuilder.java:120)
    at yoursclbizluca.android.orderdrone_bagnomaeba.main._activity_create(main.java:1074)
    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:351)
    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 yoursclbizluca.android.orderdrone_bagnomaeba.main.afterFirstLayout(main.java:104)
    at yoursclbizluca.android.orderdrone_bagnomaeba.main.access$000(main.java:17)
    at yoursclbizluca.android.orderdrone_bagnomaeba.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:907)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:216)
    at android.app.ActivityThread.main(ActivityThread.java:7625)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.widget.ViewDragHelper$Callback" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/yoursclbizluca.android.orderdrone_bagnomaeba-aGf3d4DgA-8wEiy_gdF19A==/base.apk"],nativeLibraryDirectories=[/data/app/yoursclbizluca.android.orderdrone_bagnomaeba-aGf3d4DgA-8wEiy_gdF19A==/lib/arm64, /system/lib64, /product/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 21 more
** Activity (main) Resume **

In the previous version of B4A with the old sdk the compilation worked fine, because I made many code updates for my customer.
 
Last edited:
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
I did an SDK Manager (provided by @Erel) update and now the error "Failed resolution of: Landroid/support/v4/widget/ViewDragHelper" is gone :) but I got a new compiling error :-( see the compiler log...

COMPIER LOG
-----------------
B4A Versione: 9.30
Java Versione: 8
Analisi del Codice. (0.29s)
Building folders structure. (0.07s)
Compilazione del codice. (1.41s)
Compilazione del codice di layouts (0.08s)
Organizzazione Librerie. Error
Maven artifact non trovato: androidx.activity/activity

I googled "maven artifact" and I see these: "An artifact is a file, usually a JAR".
So within my build is missing a .jar file about "androidx.activity/activity" ?
 
Last edited:
Upvote 0
Top