Error in Success callbackId: BLE483394576 : ReferenceError: test1 is not defined


cordova跨平臺,android6.0的手機上報了上面的錯誤,android8.0以上或是ios上面卻是正常的

在這裏插入圖片描述

可能原因:

報上面錯誤時的藍牙插件版本1.2.4

  • test1變量在peripheralList.js文件中聲明,
  • 而peripheralList.js文件中調用了藍牙插件cordova-plugin-ble-central的方法,
  • 而該版本的藍牙插件不能兼容該android6.0的手機

解決方案

參考博客:
cordova-plugin-ble-central插件1.2.2版android平臺掃描出現Location Services are disabled

解決方案沒有用

cordova-android:7.1.4沒有辦法安裝藍牙插件1.1.4的版本
在這裏插入圖片描述

退回到cordova-android:6.3.0

cordova add platform android@6.3.0

再執行:

cordova plugin add /Users/macvivi/Downloads/cordova-plugin-ble-central-1.1.4

裝了1.1.4的藍牙插件還是無法在android6.0的手機上使用,最後放棄兼容android6.0了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章