HarmonyOS 鸿蒙Next开发的项目,usb获取不到外接USB设备信息
HarmonyOS 鸿蒙Next 4.2.0.120 ArkUI 开发的项目,usb获取不到外接USB设备信息
不是这个原因,我是手机连接外接USB摄像头,通过usb相关api读取不到USB的设备信息
是用的DevEco Studio吗?
这开发工具版本有些旧了吧?安装4.0版本开发工具试一下
无奈啊
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: converseFromUsbDevice:deviceAosp:UsbDevice[mName=/dev/bus/usb/002/005,mVendorId=1204,mProductId=63479,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Mars,mProductName=Mars,mVersion=0.00,mSerialNumberReader=com.android.server.usb.UsbSerialReader[@b22685e](/user/b22685e), mHasAudioPlayback=false, mHasAudioCapture=false, mHasMidi=false, mHasVideoCapture=false, mHasVideoPlayback=false,mSubProductId =-1, mConfigurations=[
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=1,mInterfaces=[
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: UsbInterface[mId=0,mAlternateSetting=0,mName=trans vps data,mClass=255,mSubclass=0,mProtocol=0,mEndpoints=[
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: UsbEndpoint[mAddress=2,mAttributes=2,mMaxPacketSize=512,mInterval=0]
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
06-28 11:26:30.561 1592-17012/? I USBCoreAdapter/: UsbInterface[mId=0,mAlternateSetting=1,mName=trans vps data,mClass=255,mSubclass=0,mProtocol=0,mEndpoints=[]]]
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: converseFromUsbConfiguration:configAosp:UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=1,mInterfaces=[
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: UsbInterface[mId=0,mAlternateSetting=0,mName=trans vps data,mClass=255,mSubclass=0,mProtocol=0,mEndpoints=[
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: UsbEndpoint[mAddress=2,mAttributes=2,mMaxPacketSize=512,mInterval=0]
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: UsbInterface[mId=0,mAlternateSetting=1,mName=trans vps data,mClass=255,mSubclass=0,mProtocol=0,mEndpoints=[]]
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: converseFromUsbInterface:interfaceAospUsbInterface[mId=0,mAlternateSetting=0,mName=trans vps data,mClass=255,mSubclass=0,mProtocol=0,mEndpoints=[
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: UsbEndpoint[mAddress=2,mAttributes=2,mMaxPacketSize=512,mInterval=0]
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: converseFromUsbEndpoint:UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]interfaceId:0
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: converseFromUsbEndpoint:UsbEndpoint[mAddress=2,mAttributes=2,mMaxPacketSize=512,mInterval=0]interfaceId:0
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: converseFromUsbEndpoint:UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]interfaceId:0
06-28 11:26:30.562 1592-17012/? I USBCoreAdapter/: converseFromUsbInterface:interfaceAospUsbInterface[mId=0,mAlternateSetting=1,mName=trans vps data,mClass=255,mSubclass=0,mProtocol=0,mEndpoints=[]
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: converseFromUsbInterface:Invalid number of endpoints
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: converseFromUsbConfiguration:interfaces[1]is null
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: converseFromUsbDevice:usbConfigs[0]is null
06-28 11:26:30.562 1592-17012/? E USBCoreAdapter/: getDevices:dev is null
06-28 11:26:30.562 1592-17012/? I UsbServerStub/: RequestHandler:Result of calling hasright:{}
06-28 11:26:30.562 1592-17012/? E UsbServerStub/: RequestHandler: reslult is empty
06-28 11:26:30.562 9301-7124/? I 0FEFE/JsApp: 请插入USB摄像头
针对HarmonyOS 鸿蒙Next 4.2.0.120 ArkUI 开发的项目中USB获取不到外接USB设备信息的问题,可能的原因及解决方案如下:
- 系统Bug:根据开发者社区的反馈,此问题可能是鸿蒙系统的Bug。系统可能已识别USB设备,但解析时出错,导致无法获取设备信息。请耐心等待系统更新以修复此问题。
- USB配置:确保在设备的开发者选项中正确设置了USB配置。例如,某些情况下需要将“选择USB配置”设置为RNDIS(USB以太网)。
- 环境变量与驱动:检查HDC工具的环境变量配置是否正确,以及电脑上是否已安装与设备对应的驱动程序。
- 硬件连接:确保USB线为数据线并支持USB2.0标准,尝试更换USB线或USB接口。
如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html 。