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

Discussion in 'Additional libraries, classes and official updates' started by Johan Schoeman, Jan 24, 2016.

  1. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Without some additional information such as the log I cannot help you. Post the log please.
     
  2. suha

    suha Member Licensed 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 **
     
  3. suha

    suha Member Licensed User

    B4A version 5.80
     
  4. Johan Schoeman

    Johan Schoeman Expert Licensed User

    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.
     
    kaktus and suha like this.
  5. suha

    suha Member Licensed 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.
     
    Johan Schoeman likes this.
  6. DonManfred

    DonManfred Expert Licensed User

    It does not help if you don´t post it
     
    Johan Schoeman and suha like this.
  7. suha

    suha Member Licensed User

    WinRAR removes the READ ONLY flags. No problem with 7-zip.
     
  8. suha

    suha Member Licensed User

    If the files are not read only, they disappear after the first compilation. That is a nicety.
     
  9. DonManfred

    DonManfred Expert Licensed User

    This is the expected behaviour.
    You can use a copy of the ressources in a special folder and can use #additionalres directive to reference this dir.
    Files here dont need to be readonly.
     
    suha, Johan Schoeman and lemonisdead like this.
  10. adgency

    adgency New Member Licensed User

    Hi Johan,
    great libary! Is it possible to have image spinner, but horizontal?
    Thank you
     
  11. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Will see if I can add it to the horizontal wheel too.
     
    adgency and MarcoRome like this.
  12. gudino jose luis

    gudino jose luis Active Member Licensed User

    Excelente Libreria!!
     
    Johan Schoeman likes this.
  13. susu

    susu Well-Known Member Licensed User

    How can I add it by using code?
     
  14. Johan Schoeman

    Johan Schoeman Expert Licensed User

    In sub Globals:
    Code:
    Private vsw1 As WheelVerticalView
    In Activity_Create
    Code:
    vsw1.Initialize("vsw1")
    Activity.AddView(vsw1, 10%x10%y60%x50%y)
    Remove the customview from the designer as it will now be added via code
     
    susu likes this.
  15. Anser

    Anser Well-Known Member Licensed 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

    Code:
    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
     
  16. Johan Schoeman

    Johan Schoeman Expert Licensed 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 likes this.
  17. Anser

    Anser Well-Known Member Licensed 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
     
    Johan Schoeman likes this.
  18. Anser

    Anser Well-Known Member Licensed 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.

    Code:
    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: Jun 20, 2016
  19. Anser

    Anser Well-Known Member Licensed User

    Finally found out the Library that is incompatible with this library. It is the AndroidSlider Lib https://www.b4x.com/android/forum/t...er-daimajia-androidimageslider.59835/#content

    I had posted the error message in another thread in the Questions section and the following is the reply from Erel

    Regards
    Anser
     
  20. DonManfred

    DonManfred Expert Licensed User

    so i guess you should ask the author of this lib to remove the nineoldandroid classes from his lib and uses the jar in dependson then?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice