Android Question WheelVerticalView and AndroidSpinnerWheel error

elpic76

Member
Licensed User
Longtime User
Good morning,
I'm updating a old app that contains the WheelVerticalView but I'm obtaing the error reported in this thread:

https://www.b4x.com/android/forum/t...24-june-new-lib-files-in-post-47.62723/page-4

The problem seems to be solved in the thread but if I try the steps described there I can't solve and the in the LoadLayout I have the error.
I'm using B4A Version 10.0, java 8 (jdk1.8.0_231) and SDK version 29.
I tried the library AndroidSpinnerWheel both in version 1.00 and in version 1.01 but the error still remains.
Could you please help me to solve the error?
Could you please indicate me an alternative solution to solve the problem for example using B4X libraries?
Best regards
 

josejad

Expert
Licensed User
Longtime User
an alternative solution to solve the problem for example using B4X libraries?
Not exactly the same, but:

 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I'm using B4A Version 10.0, java 8 (jdk1.8.0_231)
1. Before you go any further with this project, upgrade to B4A version 10.5 right away before Erel sees this thread. He is not going to like the fact you are using version 10 when the current is 10.5 and free,. You may want to upgrade to jdk 11.
2. I tried one of Johan's old examples using WheelVerticalView class version 1 with SDK set at 29 and it worked without any problems.
3. Even if you want to try the thread that jose pointed out to you above, in post #2you probably need B4A 10.5 anyway., because it requires the latest XUI views lib.
 
Upvote 0

elpic76

Member
Licensed User
Longtime User
Thank you for your advices.
I tried with B4A version 10.5, jdk 8 and jdk 11, library version 1.00 and 1.01 but the error is always present :-(
I'm using B4A-Bridge version 2.60.

The log of the error is the following:

Log error:
Logger connected to:  samsung SM-A505FN
--------- beginning of crash
FATAL EXCEPTION: main
Process: JHS.AndroidSpinnerWheel, PID: 6690
java.lang.RuntimeException: Unable to create service JHS.AndroidSpinnerWheel.starter: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[])' on a null object reference
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4412)
    at android.app.ActivityThread.access$1700(ActivityThread.java:274)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2118)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[])' on a null object reference
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:164)
    at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
    at JHS.AndroidSpinnerWheel.starter.onCreate(starter.java:34)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4400)
    ... 8 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[])' on a null object reference
    at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:61)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:124)
    ... 12 more
--------- beginning of main
Not starting debugger since process cannot load the jdwp agent.
setConscryptValidator
setConscryptValidator - put
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
common created.
Starting remote logger. Port: 31973
forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4274 com.android.internal.policy.DecorView.updateColorViews:1547 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3252 android.view.Window.setFlags:1153 com.android.internal.policy.PhoneWindow.generateLayout:2474
[INFO] isPopOver = false
updateCaptionType >> DecorView@3e20aca[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
setCaptionType = 0, DecorView = DecorView@3e20aca[]
setView = com.android.internal.policy.DecorView@3e20aca TM=true MM=false
Relayout returned: old=(0,0,2340,1080) new=(83,0,2340,1080) req=(2340,1080)0 dur=8 res=0x7 s={true 487711854592} ch=true
createReliableSurface : 0x721ada1980(0x718de45000)
makeCurrent EglSurface : 0x0 -> 0x0
new_window_surface() [2257x1080] return: 0x3000
eglCreateWindowSurface : 0x718dd1b900
makeCurrent EglSurface : 0x0 -> 0x718dd1b900
mapper 3.x is not supported
Arm Module v1.0
*** Debugger waiting for connection (0) ***
show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1
SHOW: android.widget.Toast$TN@c59cef7
MSG_WINDOW_FOCUS_CHANGED 1 1
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
Starting input: tba=JHS.AndroidSpinnerWheel ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
startInputInner - Id : 0
startInputInner - mService.startInputOrWindowGainedFocus
MSG_RESIZED_REPORT: frame=(83,0,2340,1080) ci=(0,63,126,0) vi=(0,63,126,0) or=2
HANDLE SHOW: android.widget.Toast$TN@c59cef7 mView=null mNextView=android.widget.LinearLayout{79d5fd0 V.E...... ......I. 0,0-0,0}
HANDLE HIDE: android.widget.Toast$TN@c59cef7 mView=null
setView = android.widget.LinearLayout@79d5fd0 TM=true MM=false
Text: Xait in android.widget.Toast$TN@c59cef7
Relayout returned: old=(0,63,2214,1080) new=(757,796,1540,912) req=(783,116)0 dur=8 res=0x7 s={true 485667983360} ch=true
createReliableSurface : 0x721ada2c40(0x7114115000)
new_window_surface() [783x116] return: 0x3000
eglCreateWindowSurface : 0x7180bbd580
makeCurrent EglSurface : 0x718dd1b900 -> 0x7180bbd580
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
Starting input: tba=JHS.AndroidSpinnerWheel ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
startInputInner - Id : 0
MSG_RESIZED_REPORT: frame=(757,796,1540,912) ci=(0,0,0,0) vi=(391,116,783,116) or=2
HIDE: android.widget.Toast$TN@c59cef7
HANDLE HIDE: android.widget.Toast$TN@c59cef7 mView=android.widget.LinearLayout{79d5fd0 V.E...... ........ 0,0-783,116}
REMOVE! android.widget.LinearLayout{79d5fd0 V.E...... ........ 0,0-783,116} in android.widget.Toast$TN@c59cef7
makeCurrent EglSurface : 0x7180bbd580 -> 0x0
destroyEglSurface : 0x7180bbd580
eglDestroySurface() in
delete_surface() [783x116] return
eglDestroySurface() out
ReliableSurface: perform returned an error
EGLNativeWindowType 0x721ada2c50 disconnect failed
~ReliableSurface : 0x721ada2c40
dispatchDetachedFromWindow
Input channel destroyed: '60bf41d', fd=71
After accept
Log reader error: java.io.InterruptedIOException: read interrupted
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2042)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2076)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:387)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:919)
Starting remote logger. Port: 31973
After accept
java.net.SocketTimeoutException: Poll timed out
    at libcore.io.IoBridge.poll(IoBridge.java:682)
    at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:196)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:451)
    at java.net.ServerSocket.implAccept(ServerSocket.java:547)
    at java.net.ServerSocket.accept(ServerSocket.java:515)
    at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:153)
    at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
    at java.lang.Thread.run(Thread.java:919)
ViewPostIme pointer 0
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
Not starting debugger since process cannot load the jdwp agent.
setConscryptValidator
setConscryptValidator - put
Not starting debugger since process cannot load the jdwp agent.
setConscryptValidator
setConscryptValidator - put
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
common created.
Starting remote logger. Port: 31973
forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4274 com.android.internal.policy.DecorView.updateColorViews:1547 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3252 android.view.Window.setFlags:1153 com.android.internal.policy.PhoneWindow.generateLayout:2474
[INFO] isPopOver = false
updateCaptionType >> DecorView@3e20aca[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
setCaptionType = 0, DecorView = DecorView@3e20aca[]
setView = com.android.internal.policy.DecorView@3e20aca TM=true MM=false
Relayout returned: old=(0,0,2340,1080) new=(83,0,2340,1080) req=(2340,1080)0 dur=7 res=0x7 s={true 490076639232} ch=true
createReliableSurface : 0x721ada1980(0x721ad81000)
makeCurrent EglSurface : 0x0 -> 0x0
new_window_surface() [2257x1080] return: 0x3000
eglCreateWindowSurface : 0x721ae8e880
makeCurrent EglSurface : 0x0 -> 0x721ae8e880
mapper 3.x is not supported
Arm Module v1.0
After accept
*** Debugger waiting for connection (0) ***
show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1
SHOW: android.widget.Toast$TN@1808fcd
MSG_WINDOW_FOCUS_CHANGED 1 1
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
Starting input: tba=JHS.AndroidSpinnerWheel ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
startInputInner - Id : 0
startInputInner - mService.startInputOrWindowGainedFocus
MSG_RESIZED_REPORT: frame=(83,0,2340,1080) ci=(0,63,126,0) vi=(0,63,126,0) or=2
HANDLE SHOW: android.widget.Toast$TN@1808fcd mView=null mNextView=android.widget.LinearLayout{ab82ce V.E...... ......I. 0,0-0,0}
HANDLE HIDE: android.widget.Toast$TN@1808fcd mView=null
setView = android.widget.LinearLayout@ab82ce TM=true MM=false
Text: Xait in android.widget.Toast$TN@1808fcd
Relayout returned: old=(0,63,2214,1080) new=(757,796,1540,912) req=(783,116)0 dur=12 res=0x7 s={true 487486214144} ch=true
createReliableSurface : 0x721ada2740(0x7180715000)
new_window_surface() [783x116] return: 0x3000
eglCreateWindowSurface : 0x721ae8f980
makeCurrent EglSurface : 0x721ae8e880 -> 0x721ae8f980
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
Starting input: tba=JHS.AndroidSpinnerWheel ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
startInputInner - Id : 0
MSG_RESIZED: frame=(757,796,1540,912) ci=(0,0,0,0) vi=(391,116,783,116) or=2
HIDE: android.widget.Toast$TN@1808fcd
HANDLE HIDE: android.widget.Toast$TN@1808fcd mView=android.widget.LinearLayout{ab82ce V.E...... ........ 0,0-783,116}
REMOVE! android.widget.LinearLayout{ab82ce V.E...... ........ 0,0-783,116} in android.widget.Toast$TN@1808fcd
makeCurrent EglSurface : 0x721ae8f980 -> 0x0
destroyEglSurface : 0x721ae8f980
eglDestroySurface() in
delete_surface() [783x116] return
eglDestroySurface() out
ReliableSurface: perform returned an error
EGLNativeWindowType 0x721ada2750 disconnect failed
~ReliableSurface : 0x721ada2740
dispatchDetachedFromWindow
Input channel destroyed: 'a7d4de8', fd=75
*** Debugger waiting for connection (1) ***
*** Service (starter) Create ***
updateAppliedLetterboxDirection, direction=1, Caller=android.view.ViewRootImpl.handleDispatchLetterboxDirectionChanged:8091
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 32 (Main)
java.lang.RuntimeException: java.lang.ClassNotFoundException: JHS.AndroidSpinnerWheel.androidSpinnerWheelWrapper
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at JHS.AndroidSpinnerWheel.main._activity_create(main.java:393)
    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:144)
    at JHS.AndroidSpinnerWheel.main.afterFirstLayout(main.java:105)
    at JHS.AndroidSpinnerWheel.main.access$000(main.java:17)
    at JHS.AndroidSpinnerWheel.main$WaitForLayout.run(main.java:83)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by: java.lang.ClassNotFoundException: JHS.AndroidSpinnerWheel.androidSpinnerWheelWrapper
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:454)
    at java.lang.Class.forName(Class.java:379)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:389)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:453)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: JHS.AndroidSpinnerWheel.androidSpinnerWheelWrapper
    ... 24 more
null: 10
** Activity (main) Resume **
java.net.SocketException: Socket closed
    at java.net.SocketInputStream.read(SocketInputStream.java:209)
    at java.net.SocketInputStream.read(SocketInputStream.java:144)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:248)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:267)
    at anywheresoftware.b4a.shell.ShellConnector.readControlData(ShellConnector.java:191)
    at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:186)
    at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
    at java.lang.Thread.run(Thread.java:919)
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
Not starting debugger since process cannot load the jdwp agent.
setConscryptValidator
setConscryptValidator - put
Not starting debugger since process cannot load the jdwp agent.
setConscryptValidator
setConscryptValidator - put
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
common created.
Starting remote logger. Port: 31973
forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4274 com.android.internal.policy.DecorView.updateColorViews:1547 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3252 android.view.Window.setFlags:1153 com.android.internal.policy.PhoneWindow.generateLayout:2474
[INFO] isPopOver = false
updateCaptionType >> DecorView@3e20aca[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
setCaptionType = 0, DecorView = DecorView@3e20aca[]
setView = com.android.internal.policy.DecorView@3e20aca TM=true MM=false
Relayout returned: old=(0,0,2340,1080) new=(83,0,2340,1080) req=(2340,1080)0 dur=9 res=0x7 s={true 490076639232} ch=true
createReliableSurface : 0x717f4b2180(0x721ad81000)
makeCurrent EglSurface : 0x0 -> 0x0
new_window_surface() [2257x1080] return: 0x3000
eglCreateWindowSurface : 0x7189768d00
makeCurrent EglSurface : 0x0 -> 0x7189768d00
mapper 3.x is not supported
Arm Module v1.0
*** Debugger waiting for connection (0) ***
show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1
SHOW: android.widget.Toast$TN@c59cef7
MSG_WINDOW_FOCUS_CHANGED 1 1
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
Starting input: tba=JHS.AndroidSpinnerWheel ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
startInputInner - Id : 0
startInputInner - mService.startInputOrWindowGainedFocus
MSG_RESIZED_REPORT: frame=(83,0,2340,1080) ci=(0,63,126,0) vi=(0,63,126,0) or=2
HANDLE SHOW: android.widget.Toast$TN@c59cef7 mView=null mNextView=android.widget.LinearLayout{79d5fd0 V.E...... ......I. 0,0-0,0}
HANDLE HIDE: android.widget.Toast$TN@c59cef7 mView=null
setView = android.widget.LinearLayout@79d5fd0 TM=true MM=false
Text: Xait in android.widget.Toast$TN@c59cef7
Relayout returned: old=(0,63,2214,1080) new=(757,796,1540,912) req=(783,116)0 dur=11 res=0x7 s={true 487566319616} ch=true
createReliableSurface : 0x717f4b2680(0x718537a000)
new_window_surface() [783x116] return: 0x3000
eglCreateWindowSurface : 0x7180c81680
makeCurrent EglSurface : 0x7189768d00 -> 0x7180c81680
prepareNavigationBarInfo() DecorView@3e20aca[main]
getNavigationBarColor() -855310
Starting input: tba=JHS.AndroidSpinnerWheel ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
startInputInner - Id : 0
MSG_RESIZED: frame=(757,796,1540,912) ci=(0,0,0,0) vi=(0,0,783,116) or=2
HIDE: android.widget.Toast$TN@c59cef7
HANDLE HIDE: android.widget.Toast$TN@c59cef7 mView=android.widget.LinearLayout{79d5fd0 V.E...... ........ 0,0-783,116}
REMOVE! android.widget.LinearLayout{79d5fd0 V.E...... ........ 0,0-783,116} in android.widget.Toast$TN@c59cef7
makeCurrent EglSurface : 0x7180c81680 -> 0x0
destroyEglSurface : 0x7180c81680
eglDestroySurface() in
delete_surface() [783x116] return
eglDestroySurface() out
ReliableSurface: perform returned an error
EGLNativeWindowType 0x717f4b2690 disconnect failed
~ReliableSurface : 0x717f4b2680
dispatchDetachedFromWindow
Input channel destroyed: 'ef9c664', fd=71
ViewPostIme pointer 0
ViewPostIme pointer 1
ViewPostIme pointer 0
ViewPostIme pointer 1
ViewPostIme pointer 0
ViewPostIme pointer 1
After accept
java.net.SocketTimeoutException: Poll timed out
    at libcore.io.IoBridge.poll(IoBridge.java:682)
    at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:196)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:451)
    at java.net.ServerSocket.implAccept(ServerSocket.java:547)
    at java.net.ServerSocket.accept(ServerSocket.java:515)
    at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:153)
    at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
    at java.lang.Thread.run(Thread.java:919)

Have you any suggestions?
Best Regards
 
Upvote 0

elpic76

Member
Licensed User
Longtime User
Thank you again. The project is in attach.
 

Attachments

  • b4aAndroidSpinnerWheel.zip
    11.5 KB · Views: 231
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thank you again
I could not quickly figure out the problem in your project. But since mine is very, very similar to yours. I tested mine again and zipped it for you to take a look. It works for me very well. SDK set at 29, B4A 10.5 and jdk 11. Here it is attached. If not, please wait for Johan. Please note that I used version 1.0 of Johan's lib.
 

Attachments

  • b4aAndroidSpinnerWheelMahares020321.zip
    11.9 KB · Views: 252
Upvote 0

elpic76

Member
Licensed User
Longtime User
Dear Mahares,
thank you very much. Your project is running ok and I ported it to my app with success.
I used files from post #1 without horizontal spinner wheel while your project uses it so probably from post #3 or #9.
I think I won't do the verification of the correct post, it's running and that is enough :)
Thank you again.
Regards
 
Upvote 0
Top