1***@qq.com
1***@qq.com
  • 发布:2024-08-09 10:09
  • 更新:2024-09-10 01:42
  • 阅读:231

【报Bug】Hbuilder X 4.24 打包后蓝牙搜索异常

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 4.24

手机系统: Android

手机系统版本号: Android 11

手机厂商: 小米

手机机型: 红米 note9

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:
/*开始搜索周边蓝牙设备*/  
            async startBluetoothDeviceDiscovery() {  
                await bluetooth.openBluetoothAdapter();  
                let isOpenBle = uni.getStorageSync('isOpenBle');  
                if(!isOpenBle) {  
                    uni.showToast({  
                        title: '请检查是否打开蓝牙功能',  
                        icon: 'none',  
                        'duration': 2000  
                    });  
                    return;  
                }  
                uni.showLoading({  
                    title: '蓝牙搜索中'  
                })  
                this.isSearch = true  
                let self = this;  
                self.devicesList = []  
                setTimeout(() => {  
                    uni.startBluetoothDevicesDiscovery({  
                        success: res => {  
                            uni.onBluetoothDeviceFound(devices => {  
                                //不重复,就添加到devicesList中,  
                                if (!self.devicesList.some(item => {  
                                        return item.deviceId === devices.devices[0].deviceId  
                                    })&&devices.devices[0].name !== '') {  
                                    self.devicesList.push(devices.devices[0])  
                                    uni.setStorageSync('devicesList',self.devicesList)  
                                }  

                            });  
                        },  
                        fail: res => {  
                            uni.hideLoading();  
                            self.showToast(`搜索设备失败` + JSON.stringify(err));  
                        }  
                    })  
                }, 200)  
            },

预期结果:

搜索正常

实际结果:

执行后无任何反应

bug描述:

本地自定义基座运行蓝牙搜索正常,但云打包后,蓝牙搜索异常,无反应

2024-08-09 10:09 负责人:无 分享
已邀请:
4***@qq.com

4***@qq.com

解决了吗?遇到了同样的问题

要回复问题请先登录注册