Pilloxa / react-native-nordic-dfu

Nordic Device Firmware Update for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: undefined is not an object (evaluating '_context2.t0.message')

nshaposhnik opened this issue · comments

Error: undefined is not an object (evaluating '_context2.t0.message')

Current Behavior

I am using this library in my project, it's not working when calling NordicDfu.startDfu, fails with error 'undefined is not an object _context2.t0.message'. I'm trying this on iOS, apparently exception happens in line DFUServiceController * controller = [initiator start]; in RNNordicDfu.m, because when I comment this line, it disappears.

What I tried

  • using different zip dfu file
  • adding/removing 'setOnDFUComplete'/'setOnDfuError' callbacks in AppDelegate
  • checked that NSBluetoothAlwaysUsageDescription is present in Info.plsit as per react-native-ble-manager docs
  • checked that BleManager.start is called before startDfu
  • commenting out various lines in RNNordicDfu.m, which hinted me at the location of the error

Environment

iOS 14.4
iPhone 8
React Native 0.63.3

Resolved, it turns out there was additional logging in xcode apart from this JS error, and it said 'error opening zip file'. It turns out there was an issue with opening dfu file in documents directory, while RN had no trouble reading it, opening in on iOS native side did have trouble with it.