Android Question ACToolBarLight compile problem

Muhamad Kamal

Member
Licensed User
Hi!

After I've updated the latest Android SDK v29, the sample from the following thread no longer working:

https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/#content

Does anyone face the same problem?

I've got the following error during compilation:

B4X:
Compiling generated Java code.    Error
B4A line: 52
Dim jo As JavaObject = ACToolBarLight1
javac 1.8.0_201
src\b4a\example\main.java:452: error: cannot access Toolbar
_jo.setObject((java.lang.Object)(mostCurrent._actoolbarlight1.getObject()));
                                                                       ^
  class file for android.support.v7.widget.Toolbar not found

I've also downloaded the v4 and v7 support libraries and put it under "C:\android-sdk\extras\android\support" folder but this problem still exists.

No modification done to the sample code from Erel.

Can anyone please help me to solve this problem.

Thanks in advance.
 

Muhamad Kamal

Member
Licensed User
Before I did the Android SDK update, i've updated B4A to version 9.30.. at that time this sample still working fine.. after the SDK update then the compilation failed..
 
Upvote 0

Muhamad Kamal

Member
Licensed User
I removed all SDK files and re-download only the recommended list using SDK Manager.. but when I compiled it still gives the same error.. then I downloaded com.android.support:support-v4 (Google Maven) and com.android.support:appcompat-v7 (Google Maven).. still gives the same error..

For androidx there are support files for legacy appcompat v7 androidx.appcompat:appcompat included but those still does not compile.. if I remove this feature then the Lib for AppCompat in B4A could not be selected..

Any other idea?
 
Upvote 0

Muhamad Kamal

Member
Licensed User
if I add the following code to my activity module the errors are in the inline code section below:

in Main activity module:
#AdditionalRes: C:\android-sdk\extras\android\support\v7\appcompat\res, android.support.v7.appcompat

the appcompat-v7 support files were downloaded and added manually to the support folder..

B4X:
B4A Version: 9.30
Java Version: 8
Parsing code.    (0.01s)
Building folders structure.    (0.05s)
Compiling code.    (0.02s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    Error
c:\android-sdk\extras\android\support\v7\appcompat\res\values\attrs.xml:88: error: Attribute "actionBarSize" already defined with incompatible format.
c:\android-sdk\tools\..\extras\b4a_remote\androidx\appcompat\appcompat\1.0.2\unpacked-appcompat-1.0.2\res\values\values.xml:435: Original attribute defined here.
c:\android-sdk\extras\android\support\v7\appcompat\res\values\attrs.xml:165: error: Attribute "navigationMode" already defined with incompatible format.
c:\android-sdk\tools\..\extras\b4a_remote\androidx\appcompat\appcompat\1.0.2\unpacked-appcompat-1.0.2\res\values\values.xml:74: Original attribute defined here.
c:\android-sdk\extras\android\support\v7\appcompat\res\values\attrs.xml:174: error: Attribute "displayOptions" already defined with incompatible format.
c:\android-sdk\tools\..\extras\b4a_remote\androidx\appcompat\appcompat\1.0.2\unpacked-appcompat-1.0.2\res\values\values.xml:82: Original attribute defined here.
c:\android-sdk\extras\android\support\v7\appcompat\res\values\attrs.xml:410: error: Attribute "showAsAction" already defined with incompatible format.
c:\android-sdk\tools\..\extras\b4a_remote\androidx\appcompat\appcompat\1.0.2\unpacked-appcompat-1.0.2\res\values\values.xml:921: Original attribute defined here.
c:\android-sdk\extras\android\support\v7\appcompat\res\values\attrs.xml:488: error: Attribute "showDividers" already defined with incompatible format.
c:\android-sdk\tools\..\extras\b4a_remote\androidx\appcompat\appcompat\1.0.2\unpacked-appcompat-1.0.2\res\values\values.xml:803: Original attribute defined here.
 
Upvote 0

Muhamad Kamal

Member
Licensed User
upload_2019-9-5_3-36-21.png
 
Upvote 0

Muhamad Kamal

Member
Licensed User
I don't see any troubles. AppCompat is the same. SlidingMenuWrapper - 1.10.
Did you execute Jetifier in tools ?

I'm still learning about jetifier and still not fully understand how to migrate the library.. any source of reading that you could point me to?
most of my apps now are still using ACToolBarLight and quite a lot of coding need to be changed if this method is no longer usable in AndroidX..

I even tried updating all the SDK files using Android Studio but this error still exist..
 
Upvote 0

Muhamad Kamal

Member
Licensed User
no compilation error.. however I'm getting this error during app launch:

B4X:
Logger connected to:  samsung SM-G935F
--------- beginning of main
** Activity (main) Resume **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:181)
    at anywheresoftware.b4a.objects.SlidingMenuWrapper.Initialize(SlidingMenuWrapper.java:26)
    at b4a.example.main._activity_create(main.java:413)
    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 b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.ViewConfigurationCompat" on path: DexPathList[[zip file "/data/app/b4a.example-XmwqylRmBfvTxkt6zxQ12A==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-XmwqylRmBfvTxkt6zxQ12A==/lib/arm64, /system/lib64, /system/vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 24 more
** Activity (main) Resume **
 
Upvote 0
Top