Android Question b4xgifview error when run project

meysam211

Member

Attachments

  • image_2026-07-19_141424074.png
    image_2026-07-19_141424074.png
    212.6 KB · Views: 32

meysam211

Member
error:
Logger connected to:  Xiaomi 2404ARN45A
--------- beginning of main
Copying updated assets files (4)
*** Service (starter) Create ***
*** Service (starter) Create completed ***
*** Service (starter) Started ***
** Service (starter) Start **
*** Service (starter) Started completed ***
** Activity (main) Create (first time) **
Error occurred on line: 83 (B4XGifView)
java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1142)
    at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:1068)
    at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:425)
    at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:245)
    at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:259)
    at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:165)
    at b4a.example.main._activity_create(main.java:415)
    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:157)
    at b4a.example.main.afterFirstLayout(main.java:105)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:83)
    at android.os.Handler.handleCallback(Handler.java:1029)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loopOnce(Looper.java:274)
    at android.os.Looper.loop(Looper.java:369)
    at android.app.ActivityThread.main(ActivityThread.java:10090)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:616)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1137)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
    at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
    ... 25 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
    ... 26 more
Caused by: java.lang.ClassNotFoundException: pl$droidsonroids$gif$GifDrawable
    at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:316)
    at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:104)
    at b4a.example.b4xgifview._setbitmap(b4xgifview.java:211)
    at b4a.example.b4xgifview._setgif2(b4xgifview.java:241)
    at b4a.example.b4xgifview._setgif(b4xgifview.java:57)
    at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:57)
    ... 28 more
** Activity (main) Resume **
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

meysam211

Member
The example works fine here...

Have you downloaded the additional dependencies and copied them to the additional libs folder: https://www.b4x.com/android/forum/t...ss-platform-animated-gif-view.118550/#content

Can you post the full text from the compilation window?

Last question - are you running it on a real device? Which one?
Yes, I put all the requirements in the library folder and the answer to your second question is yes, I run the program on a real device.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Yes, I put all the requirements in the library folder
Just as a check, be sure to put the dependencies and the gif library in the Additional Libraries B4X folder and not in the B4A Internal libraries folder.
And check if the path to Additional Libraries folder is correctly set in B4A configuration.
 
Upvote 0

meysam211

Member
Just as a check, be sure to put the dependencies and the gif library in the Additional Libraries B4X folder and not in the B4A Internal libraries folder.
And check if the path to Additional Libraries folder is correctly set in B4A configuration.
I checked both items and I did everything correctly, but the problem still persists.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
What effect does this have?
It works fine on the lastest version B4A.

If these dependent libraries are missing, it will throw an error during compiling. .
The issue here is that the runtime failure to find pl$droidsonroids$gif$GifDrawable.
1. Please show your dependency library versions.
2. What model is your Xiaomi phone?
 
Upvote 0

meysam211

Member
I have attached all the documents for you. Please take a look and see where the problem lies.
 

Attachments

  • dep1.png
    dep1.png
    270.6 KB · Views: 14
  • dep2.png
    dep2.png
    266.6 KB · Views: 12
  • dep3.png
    dep3.png
    240 KB · Views: 13
  • dep4.jpg
    dep4.jpg
    75.3 KB · Views: 14
Upvote 0

teddybear

Well-Known Member
Licensed User
Last edited:
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
I think it's worth to add a step in the Installation Guide with the correct structure of the Additional Libraries Folder and the info that it must not be inside the Program Files folder.
 
Upvote 0
Top