Android Question BLE - "Error starting scan" only on WIKO brand

jemajuca

Member
Licensed User
Hello.
I'm speriencing the following error only this phone:
Brand: WIKO Model: JERRY Android version: 6.0 Security patch: May 5 2017
I'm using BLE2 library.

B4X:
principal_activity_create (java line: 468)
java.lang.RuntimeException: Object should first be initialized (Panel).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
    at anywheresoftware.b4a.objects.ViewWrapper.setVisible(ViewWrapper.java:271)
    at xxx.yyy.zzz.principal._activity_create(principal.java:468)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at xxx.yyy.zzz.principal.afterFirstLayout(principal.java:102)
    at xxx.yyy.zzz.principal.access$000(principal.java:17)
    at xxx.yyy.zzz.principal$WaitForLayout.run(principal.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5452)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:762)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
java.lang.RuntimeException: Object should first be initialized (Panel).
** Activity (principal) Resume **
principal_btpairscan (java line: 573)
java.lang.RuntimeException: Error starting scan.
    at anywheresoftware.b4a.objects.BleManager2.Scan2(BleManager2.java:142)
    at anywheresoftware.b4a.objects.BleManager2.Scan(BleManager2.java:112)
    at xxx.yyy.zzz.principal._btpairscan(principal.java:573)
    at xxx.yyy.zzz.principal._activity_resume(principal.java:541)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
    at xxx.yyy.zzz.principal.afterFirstLayout(principal.java:108)
    at xxx.yyy.zzz.principal.access$000(principal.java:17)
    at xxx.yyy.zzz.principal$WaitForLayout.run(principal.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5452)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:762)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
java.lang.RuntimeException: Error starting scan.

What could be causing this problem?
-Phone updates? (Not pending updates)
-Incomplete Manifest?
 

jemajuca

Member
Licensed User
Oh yes, there is also that pending error, but no problem on any phones but this one.
The real crashing error is the "error starting scan"
I can't see more information on the unfiltered log about this error.
Any thought to catch it?
 
Upvote 0

jemajuca

Member
Licensed User
Sorry, previous attached log was filtered.
This is the unfiltered log on the WIKO phone:
B4X:
--------- beginning of main
ClassLoader referenced unknown path: /data/app/xxx.yyy.zzz-1/lib/arm
Starting remote logger. Port: 53028
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = xxx.yyy.zzz.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
** Activity (main) Create, isFirst = true **
Suspending all threads took: 10.803ms
Background partial concurrent mark sweep GC freed 2001(127KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 1041KB/2MB, paused 12.390ms total 23.162ms
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (principal) Create, isFirst = true **
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
Carpeta File.DirInternal : /data/user/0/xxx.yyy.zzz/files
Carpeta File.DirDefaultExternal : /storage/emulated/0/Android/data/xxx.yyy.zzz/files
** Activity (principal) Resume **
Skipped 185 frames!  The application may be doing too much work on its main thread.
Remote logger timeout: 1
Starting remote logger. Port: 53028
Remote logger timeout: 2
Starting remote logger. Port: 53028
** Activity (principal) Pause, UserClosed = false **
catching B4AUncaughtException
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: pairing_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
Ignoring event: manager_statechanged
** Activity (principal) Resume **
** Activity (principal) Pause, UserClosed = false **
catching B4AUncaughtException
ClassLoader referenced unknown path: /data/app/xxx.yyy.zzz-2/lib/arm
Starting remote logger. Port: 53028
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = xxx.yyy.zzz.main@93480e0, userId = 0
After accept
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/xxx.yyy.zzz-2/lib/arm
Starting remote logger. Port: 53028
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = xxx.yyy.zzz.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
** Activity (main) Create, isFirst = true **
After accept
** Activity (main) Resume **
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 53028
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/xxx.yyy.zzz-2/lib/arm
Starting remote logger. Port: 53028
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = xxx.yyy.zzz.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/xxx.yyy.zzz-1/lib/arm
Starting remote logger. Port: 53028
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = xxx.yyy.zzz.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
** Activity (main) Create, isFirst = true **
After accept
** Activity (main) Resume **
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 53028
After accept
-1 received
writer error
java.net.SocketException: sendto failed: EBADF (Bad file descriptor)
    at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:542)
    at libcore.io.IoBridge.sendto(IoBridge.java:511)
    at java.net.PlainSocketImpl.write(PlainSocketImpl.java:500)
    at java.net.PlainSocketImpl.-wrap1(PlainSocketImpl.java)
    at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:266)
    at java.io.OutputStream.write(OutputStream.java:82)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:161)
    at java.lang.Thread.run(Thread.java:818)
Caused by: android.system.ErrnoException: sendto failed: EBADF (Bad file descriptor)
    at libcore.io.Posix.sendtoBytes(Native Method)
    at libcore.io.Posix.sendto(Posix.java:211)
    at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:278)
    at libcore.io.IoBridge.sendto(IoBridge.java:509)
    ... 6 more
Starting remote logger. Port: 53028
After accept
-1 received
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 53028
After accept
** Activity (main) Pause, UserClosed = false **
** Activity (principal) Create, isFirst = true **
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
setSubtitleAnchor in MediaPlayer
Carpeta File.DirInternal : /data/user/0/xxx.yyy.zzz/files
Carpeta File.DirDefaultExternal : /storage/emulated/0/Android/data/xxx.yyy.zzz/files
** Activity (principal) Resume **
Skipped 187 frames!  The application may be doing too much work on its main thread.
startLeScan(): null
principal_btpairscan (java line: 577)
java.lang.RuntimeException: Error starting scan.
    at anywheresoftware.b4a.objects.BleManager2.Scan2(BleManager2.java:142)
    at anywheresoftware.b4a.objects.BleManager2.Scan(BleManager2.java:112)
    at xxx.yyy.zzz.principal._btpairscan(principal.java:577)
    at xxx.yyy.zzz.principal._activity_resume(principal.java:545)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
    at xxx.yyy.zzz.principal.afterFirstLayout(principal.java:108)
    at xxx.yyy.zzz.principal.access$000(principal.java:17)
    at xxx.yyy.zzz.principal$WaitForLayout.run(principal.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5452)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:762)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
java.lang.RuntimeException: Error starting scan.
 
Upvote 0

jemajuca

Member
Licensed User
Erel, the BLE2 example give us some help.
Please see attached image and code.
The Alcatel is showing buttons correctly, but the Wiko says "BLE State: unsupported" but it has BLE.
B4X:
--------- beginning of main
ClassLoader referenced unknown path: /data/app/b4a.example3-1/lib/arm
Bridge logger not enabled.
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = b4a.example3.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
ignoring event: statechanged
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: b4a.example3.customlistview
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/b4a.example3-2/lib/arm
Bridge logger not enabled.
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = b4a.example3.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
ignoring event: statechanged
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: b4a.example3.customlistview
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/b4a.example3-1/lib/arm
Starting remote logger. Port: 29707
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = b4a.example3.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
ignoring event: statechanged
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: b4a.example3.customlistview
** Activity (main) Resume **
After accept
Registo conectado a:  WIKO JERRY
After accept
--------- beginning of main
ClassLoader referenced unknown path: /data/app/b4a.example3-1/lib/arm
Bridge logger not enabled.
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = b4a.example3.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
ignoring event: statechanged
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: b4a.example3.customlistview
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/b4a.example3-2/lib/arm
Bridge logger not enabled.
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = b4a.example3.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
ignoring event: statechanged
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: b4a.example3.customlistview
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
ClassLoader referenced unknown path: /data/app/b4a.example3-1/lib/arm
Starting remote logger. Port: 29707
getInstance() new sInstance = android.view.accessibility.AccessibilityManager@25c1ee3, context = b4a.example3.main@93480e0, userId = 0
Use EGL_SWAP_BEHAVIOR_PRESERVED: false
*** Service (starter) Create ***
** Service (starter) Start **
Initialized EGL, version 1.4
ignoring event: statechanged
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: b4a.example3.customlistview
** Activity (main) Resume **
After accept
Remote logger timeout: 1
writer error
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1988)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:357)
    at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
    at java.lang.Thread.run(Thread.java:818)
Starting remote logger. Port: 29707
After accept
** Activity (main) Pause, UserClosed = false **
IMG_20180220_134531.jpg
 
Upvote 0

jemajuca

Member
Licensed User
Yes, the problem is a hardware fail.
This phone has BLE, but it seems broken now.
Tried to factory reset and BLE is not supported, so it need to be repaired.
Thank you anyway!
 
Upvote 0
Top