B4A Library Spinner Wheel - Vertical and Horizontal (24 June: new lib files in post #47)

suha

Member
Licensed User
Longtime User
Thanks.


** Activity (main) Pause, UserClosed = false **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 36 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
at JHS.AndroidSpinnerWheel.main._activity_create(main.java:360)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:702)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at JHS.AndroidSpinnerWheel.main.afterFirstLayout(main.java:102)
at JHS.AndroidSpinnerWheel.main.access$000(main.java:17)
at JHS.AndroidSpinnerWheel.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
... 22 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1123)
at android.content.res.Resources.getDrawable(Resources.java:698)
at androidspinnerwheelwrapper.androidVerticalWheelWrapper.updateSpinner(androidVerticalWheelWrapper.java:103)
at androidspinnerwheelwrapper.androidVerticalWheelWrapper.setupSpinnerWheel(androidVerticalWheelWrapper.java:90)
at androidspinnerwheelwrapper.androidVerticalWheelWrapper._initialize(androidVerticalWheelWrapper.java:65)
... 26 more
** Activity (main) Resume **
** Activity (main) Resume **
Connected to B4A-Bridge (Wifi)
** Activity (main) Pause, UserClosed = false **
 

Johan Schoeman

Expert
Licensed User
Longtime User
B4A version 5.80
The 11th line from the bottom tells you what the problem is. You are missing files in the Objects/res/.....folders of the B4A project. Make sure they are there - look in the folders of the projects that I have posted and then make sure the files in those folders are set to READ ONLY.
 

suha

Member
Licensed User
Longtime User
Yes, this solved the problem! The files were not READ ONLY. I have just uncompressed your project using WinRAR as many other projects. I have not touched the file permissions. Can you tell what happened?


Thanks for the immediate help.
 

suha

Member
Licensed User
Longtime User
If the files are not read only, they disappear after the first compilation. That is a nicety.
 

adgency

New Member
Licensed User
Longtime User
Hi Johan,
great libary! Is it possible to have image spinner, but horizontal?
Thank you
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan,
great libary! Is it possible to have image spinner, but horizontal?
Thank you
Will see if I can add it to the horizontal wheel too.
 

susu

Well-Known Member
Licensed User
Longtime User
How can I add it by using code?
 

Johan Schoeman

Expert
Licensed User
Longtime User
How can I add it by using code?
In sub Globals:
B4X:
Private vsw1 As WheelVerticalView

In Activity_Create
B4X:
vsw1.Initialize("vsw1")
Activity.AddView(vsw1, 10%x, 10%y, 60%x, 50%y)

Remove the customview from the designer as it will now be added via code
 

Anser

Well-Known Member
Licensed User
Longtime User
Hi Johan,

The lib looks really nice. Good work

I am testing this lib using the sample app from post no #12 of this thread b4aAndroidSpinnerWheel.zip
I have used the Lib posted in the Post no #17 of this thread AndroidSpinnerWheel.zip.

Unfortunately when I compile the sample I app I get the following error

B4X:
B4A version: 5.80
Parsing code. (0.00s)
Compiling code. (0.02s)
Compiling layouts code. (0.00s)
Generating R file. (0.07s)
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\nineoldandroids-2.4.0.jar
It looks like the lib is depended on nineoldandroids-2.4.0.jar


I already have NineOldAndroids by Informatix from the thread https://www.b4x.com/android/forum/threads/nineoldandroids.44393/

That's the only NineOldAndroids that I could find on this forum.

Any help will be appreciated

Regards
Anser
 

Johan Schoeman

Expert
Licensed User
Longtime User
@lemonisdead had a similar problem here....

https://www.b4x.com/android/forum/t...-100-embedded-in-b4a.63794/page-2#post-430029

Maybe she can shed some light on how she solved the problem. Have you tried to "clean" the project?
 

Anser

Well-Known Member
Licensed User
Longtime User
Sorry for creating the confusion.

As you have mentioned in the Thread Title that the latest lib is available in post #17, I straight away jumped into post #17 and downloaded it for my tests. Except the lib zip file in post #17,all the other previous library uploads by you in this thread contains the nineoldandroids-2.4.0.jar along with the Lib zip file .

Tested and it is working fine.

Regards
Anser
 

Anser

Well-Known Member
Licensed User
Longtime User
Your sample is working fine. But when I add to my existing project, I get the following compilation error. It looks like that is is related to the nineoldandroids.

B4X:
Parsing code.    (0.12s)
Compiling code.    (0.37s)
Compiling layouts code.    (0.03s)
Generating R file.    (0.90s)
Compiling generated Java code.    (2.53s)
Convert byte code - optimized dex.    Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/nineoldandroids/animation/Animator$AnimatorListener;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
    at com.android.dx.command.dexer.Main.processClass(Main.java:615)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
    at com.android.dx.command.dexer.Main.access$2(Main.java:546)
    at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:537)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
    at com.android.dx.command.dexer.Main.run(Main.java:206)
    at com.android.dx.command.dexer.Main.main(Main.java:179)
    at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting

Another thing noticed is that even though the nineoldandroids-2.4.0.jar is there in my additional lib folder it doesn't appear in the Libraries list.

In your sample, if you check the Libraries used, nineoldandroids-2.4.0.jar is not there in the list. It looks like your lib calls this internally.

Edit : - I assume that this lib is conflicting with some other libs already used in my project.
Edit : - If I remove this lib from my project then everything works fine. I tried clean project too.
 
Last edited:

Anser

Well-Known Member
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…