Android Question Unable to load CircleMenu example , need help

ht_admin

Member
Hi

I am trying to Run example Circle Menu, and i am getting errors,

Main - 46: Undeclared variable 'menu' is used before it was assigned any value.
Main - 44: Undeclared variable 'menu' is used before it was assigned any value.
Main - 42: Undeclared variable 'menu' is used before it was assigned any value.
Main - 40: Undeclared variable 'menu' is used before it was assigned any value.
Main - 28: Unknown type: circlemenu<br />Are you missing a library reference?
Main - 36: Unused variable 'rescolors'. (warning #9)
Main - 38: Unused variable 'icons'. (warning #9)
Library 'AppCompat' is not used. (warning #32)

I have also added Additional library folder as you can see in image, but still unable to fix error,
i am using b4a 10.7

Kindly guide me
 

Attachments

  • snapb4a.jpg
    snapb4a.jpg
    61.2 KB · Views: 222
  • b4a_image1.jpg
    b4a_image1.jpg
    8.7 KB · Views: 209

ht_admin

Member
Now i am getting different error
i have changed #AdditionalRes: D:\project\Android\b4a\B4ACircle Menu Example\B4ACircle Menu Example\Objects\res
path according to my folder

Logger connected to: motorola XT1033
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 40 (Main)
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1266)
at android.content.res.Resources.getDrawable(Resources.java:785)
at android.content.res.Resources.getDrawable(Resources.java:752)
at com.hitomi.cmlibrary.CircleMenu.convertDrawable(CircleMenu.java:627)
at com.hitomi.cmlibrary.CircleMenu.setMainMenu(CircleMenu.java:649)
at com.genesis.circlemenu.B4ACircleMenu.Initialize(B4ACircleMenu.java:37)
at com.genesis.circlemenu.main._activity_create(main.java:398)
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:348)
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 com.genesis.circlemenu.main.afterFirstLayout(main.java:105)
at com.genesis.circlemenu.main.access$000(main.java:17)
at com.genesis.circlemenu.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
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:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
** Activity (main) Resume **

the app starts and closes immediately
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I was able to run it without doing anything special. Just put the resources in <Project>\res and add:
B4X:
#AdditionalRes: ..\res

I've then got this error:

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
--------- beginning of crash
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/graphics/ColorUtils;
at com.hitomi.cmlibrary.CircleMenu.calcAlphaColor(CircleMenu.java:493)
at com.hitomi.cmlibrary.CircleMenu.drawSubMenu(CircleMenu.java:280)
at com.hitomi.cmlibrary.CircleMenu.onDraw(CircleMenu.java:192)
at android.view.View.draw(View.java:22350)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4101)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3828)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3099)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:731)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: android.support.v4.graphics.ColorUtils
... 42 more

It happens because this library is based on the old Android Support library. Tools - Jetify + Clean project fixed it.
 
Upvote 0

ht_admin

Member
Again getting error, i clean project and ran.

Logger connected to: motorola XT1033
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/graphics/ColorUtils;
at com.hitomi.cmlibrary.CircleMenu.calcAlphaColor(CircleMenu.java:493)
at com.hitomi.cmlibrary.CircleMenu.drawSubMenu(CircleMenu.java:280)
at com.hitomi.cmlibrary.CircleMenu.onDraw(CircleMenu.java:192)
at android.view.View.draw(View.java:15249)
at android.view.View.updateDisplayListIfDirty(View.java:14185)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3391)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3370)
at android.view.View.updateDisplayListIfDirty(View.java:14145)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3391)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3370)
at android.view.View.updateDisplayListIfDirty(View.java:14145)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3391)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3370)
at android.view.View.updateDisplayListIfDirty(View.java:14145)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3391)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3370)
at android.view.View.updateDisplayListIfDirty(View.java:14145)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3391)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3370)
at android.view.View.updateDisplayListIfDirty(View.java:14145)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3391)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3370)
at android.view.View.updateDisplayListIfDirty(View.java:14145)
at android.view.View.getDisplayList(View.java:14207)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2560)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2382)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2012)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1084)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5990)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
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:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.graphics.ColorUtils" on path: DexPathList[[zip file "/data/app/com.genesis.circlemenu-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)
... 50 more
Suppressed: java.lang.ClassNotFoundException: android.support.v4.graphics.ColorUtils
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)

Message longer than Log limit (4000). Message was truncated.
--------- beginning of crash
 
Upvote 0
Top