Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on startDfu process: Exception '*** -[_NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]' #100

Closed
ezranbayantemur opened this issue Jun 8, 2020 · 3 comments

Comments

@ezranbayantemur
Copy link
Contributor

ezranbayantemur commented Jun 8, 2020

I did every step on installation process but stil getting error while starting DFU.

My code is:

         ...
         ...
            let
                formatFile = await DocumentPicker.pick({ type: DocumentPicker.types.zip }).catch(err => { throw "ERR_100" }),
                await BleManager.start()
                await NordicDFU.startDFU({ deviceAddress: "DC:5E:D4:87:DE:16", filePath: formatFile.uri }).catch(err => { throw err })
         ...
         ...

I don't know why and how this error happens.

Screenshot:
IMG_1260

package.json

    "react": "16.11.0",
    "react-native": "0.62.2",
    "react-native-ble-manager": "^7.2.0",
    "react-native-ble-plx": "^2.0.0",
    "react-native-camera": "^3.26.0",
    "react-native-document-picker": "^3.4.0",
    "react-native-fs": "^2.16.6",
    "react-native-modal": "^11.5.6",
    "react-native-nordic-dfu": "^3.1.0"
@ezranbayantemur
Copy link
Contributor Author

@Looveh Do you have any idea?

@ezranbayantemur
Copy link
Contributor Author

It looks like an issue about filePath value. If you give any invalid route it throws same error.

@ezranbayantemur
Copy link
Contributor Author

It was a problem about selecting the file. On iOS side if user will select a format file, file type should be public.archive. I was using DocumentPicker.types.zip

So changing this line

let formatFile = await DocumentPicker.pick({ type: DocumentPicker.types.zip }).catch(err => { throw "ERR_100" })

to

let formatFile = await DocumentPicker.pick({ type: 'public.archive' }).catch(err => { throw "ERR_100" })

solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant