Android Question xImageSliderIG compilation error

peacemaker

Well-Known Member
Licensed User
Error at compiling:
B4X:
B4A Version: 9.30
Java Version: 11
Parsing code.    (0.02s)
Building folders structure.    (0.01s)
Compiling code.    Error
Error compiling program.
Error description: ',' expected.
Error occurred on line: 87
Imgcont.Initialize("ImgCont")
Word: )
Cannot understand where it is
 

peacemaker

Well-Known Member
Licensed User
version of your AHViewPager library
It was indeed some old, now updated to v.3.0 and have new error :
B4X:
B4A Version: 9.30
Java Version: 11
Parsing code.    (0.03s)
Building folders structure.    (0.02s)
Compiling code.    (0.23s)
Compiling layouts code.    (0.03s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (0.58s)
Compiling debugger engine code.    (2.15s)
Compiling generated Java code.    Error
B4A line: 458
Imgcont.PageContainer = imgLayout
src\b4a\example\ximagesliderig.java:156: error: cannot find symbol
__ref._imgcont /*de.amberhome.viewpager.AHViewPager*/ .setPageContainer(__ref._imglayout /*de.amberhome.viewpager.AHPageContainer*/ );
                                                      ^
  symbol:   method setPageContainer(AHPageContainer)
  location: variable _imgcont of type AHViewPager
 

peacemaker

Well-Known Member
Licensed User
@Brandsum , next trouble is:
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 392 (xImageSliderIG)
java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
    at android.view.View.sanitizeFloatPropertyValue(View.java:15425)
    at android.view.View.sanitizeFloatPropertyValue(View.java:15399)
    at android.view.View.setScaleX(View.java:14788)
    at android.animation.PropertyValuesHolder.nCallFloatMethod(Native Method)
    at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
    at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
    at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
    at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
    at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
    at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
    at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
    at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
    at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
    at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
    at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
    at android.animation.AnimatorSet.start(AnimatorSet.java:729)
    at android.animation.AnimatorSet.start(AnimatorSet.java:684)
    at anywheresoftware.b4a.objects.B4XViewWrapper.SetLayoutAnimated(B4XViewWrapper.java:158)
    at peacemaker.upravdom.ximagesliderig._sethidden(ximagesliderig.java:1053)
    at peacemaker.upravdom.ximagesliderig._updatedots(ximagesliderig.java:852)
    at peacemaker.upravdom.ximagesliderig._imgcont_pagechanged(ximagesliderig.java:730)
    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:348)
    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 anywheresoftware.b4a.BA$1.run(BA.java:335)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
    at android.view.View.sanitizeFloatPropertyValue(View.java:15425)
    at android.view.View.sanitizeFloatPropertyValue(View.java:15399)
    at android.view.View.setScaleX(View.java:14788)
    at android.animation.PropertyValuesHolder.nCallFloatMethod(Native Method)
    at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
    at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
    at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
    at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
    at android.animation.ValueAnimator.start(ValueAnimator.java:1071)
    at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
    at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
    at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
    at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
    at android.animation.AnimatorSet.doAnimationFrame(AnimatorSet.java:1046)
    at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
    at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
    at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
    at android.view.Choreographer.doCallbacks(Choreographer.java:761)
    at android.view.Choreographer.doFrame(Choreographer.java:693)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Error occured during sliding at 7'th picture of 8 loaded by this code:

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("1")
    Slider.activityHasActionBar = False
    Dim sc As SliderContainer
    sc.Initialize
    sc.slider = Slider
    sc.items.Initialize
          
    For i = 1 To 8
        sc.items.put(LoadBitmap(File.DirAssets,"_" & i & ".jpg"),"Item " & i)
    Next
  
    sc.slider.SetImages(sc.items)
    sc.slider.SetZoomPanel(Activity)
End Sub
This message is just for reference - now i understand that lib can have tons of such unknown error, and always it needs to apply to the lib author.
So, i prefer to use classes that can be debugged and customized.
Anyway, thanks for the lib.
 

Brandsum

Well-Known Member
Licensed User
Error log doesn't have any useful information. So can you post your project?

You can always extract the class from b4xlib and can modify it. Its comparatively easy to store and include a b4xlib in a project rather than a class file.
 
Top