Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Error: Attempt to invoke interface method 'int android.database.Cursor.getColumnIndexOrThrow(java.lang.String)' on a null object #12

Open
taichi-jp opened this issue Jun 15, 2018 · 9 comments

Comments

@taichi-jp
Copy link

taichi-jp commented Jun 15, 2018

When excuting the code below,

RNGRP.getRealPathFromURI(payload.uri)
    .then((filePath: string) => console.log(filePath))
    .catch((error: string) => console.log(error));

It raises an error saying:

Error: Attempt to invoke interface method 'int android.database.Cursor.getColumnIndexOrThrow(java.lang.String)' on a null object reference
    at convertError (GRP.common.js:21)
    at tryCatcher (bluebird.js:4594)
    at Promise._settlePromiseFromHandler (bluebird.js:2698)
    at Promise._settlePromiseAt (bluebird.js:2772)
    at Promise._settlePromises (bluebird.js:2888)
    at Async._drainQueue (bluebird.js:175)
    at Async._drainQueues (bluebird.js:185)
    at Async.drainQueues (bluebird.js:67)
    at JSTimers.js:301
    at _callTimer (JSTimers.js:154)
    at _callImmediatesPass (JSTimers.js:202)
    at Object.callImmediates (JSTimers.js:470)
    at MessageQueue.__callImmediates (MessageQueue.js:329)
    at MessageQueue.js:147
    at MessageQueue.__guardSafe (MessageQueue.js:316)
    at MessageQueue.flushedQueue (MessageQueue.js:146)

(I tried this solution to build successfully: #10 (comment))

@taichi-jp
Copy link
Author

Does this mean payload.uri is a wrong URI ?

@ggunti
Copy link

ggunti commented Aug 1, 2018

Same error

@ggunti
Copy link

ggunti commented Aug 4, 2018

Why it throws this error? It worked before.

@acuntex
Copy link

acuntex commented Aug 29, 2018

Any updates on this?
Or is this another dead project? :(

@ggunti
Copy link

ggunti commented Aug 29, 2018

No updates as I know :(

@Faolain
Copy link

Faolain commented Sep 8, 2018

same issue here, is it a result of an invalid uri?

@adeelYasin
Copy link

adeelYasin commented Nov 29, 2018

You have to add storage Permissions at runtime. As this error occurs in Android devices having version above Marshmellow. So use this package.! It works for me.
https://www.npmjs.com/package/react-native-permissions

@medelvann
Copy link

@adeelYasin thanks for you help , thats work
i using DocumentPicker Package , when i choose file from Downloads this error happened again , and when i choose file from
Download folder in internal storage , uri successfully converted.

photo_2018-12-03_13-24-28

@khanna007
Copy link

@medelvann can i have full code of this issue i am also stucked in this type of issue.

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

No branches or pull requests

7 participants