Android Question [solved] Genymotion and FelUSBserial

wroyw

Member
Licensed User
Hi,
I try to use Genymotion emulator with USB serial port support.
I use the FelUSBserial library. My ports are found in Genymotion and my app.
But when I use the Initialize2 command it crashs
B4X:
dev.Initialize2("MyDev",aDevice,-1,"CP2102SerialDevice")
On my phone it works but in Genymotion I get following error :

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.hardware.usb.UsbDeviceConnection.claimInterface(android.hardware.usb.UsbInterface, boolean)' on a null object reference
at com.felhr.usbserial.CP2102SerialDevice.openCP2102(CP2102SerialDevice.java:518)
at com.felhr.usbserial.CP2102SerialDevice.open(CP2102SerialDevice.java:99)
at anywheresoftware.b4a.objects.usb.felUsbSerial.Initialize2(felUsbSerial.java:73)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:167)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
at b4a.example.main._checkdevices(main.java:1020)
at b4a.example.main._activity_create(main.java:958)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.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:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 
Top