Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Could not automatically link package :TypeError: path must be a string or Buffer #435

Closed
sujanbasnet opened this issue Jul 18, 2017 · 4 comments

Comments

@sujanbasnet
Copy link

sujanbasnet commented Jul 18, 2017

Hey !

I get this problem while trying to link the library, simple react-native link works but it suggests:

react-native-fetch-blob_ will not automatically add Android permissions after 0.9.4 please run the following command if you want to add default permissions :

RNFB_ANDROID_PERMISSIONS=true react-native link

And when I do RNFB_ANDROID_PERMISSIONS=true react-native link it give me the following error:

RNFetchBlob checking app version ..
RNFetchBlob detected app version => 0.45
Add Android permissions => false
react-native-fetch-blob link FAILED
Could not automatically link package :TypeError: path must be a string or Buffer
at TypeError (native)
at Object.fs.readFile (fs.js:304:11)
at Object. (/Users/Sujan/Desktop/React Native/RelaxationApp/node_modules/react-native-fetch-blob/scripts/prelink.js:29:8)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)

If I run the project with simple react-native link I get : undefined is not an object (evaluating 'RNFetchBlob.DocumentDir') when the project is run


Versions:

react-native-cli: 2.0.1
react-native: 0.45.1

RNFetchBlob: 0.10.6

@wkh237
Copy link
Owner

wkh237 commented Jul 18, 2017

It's like your Android project does not exists or not using a default project structure, as a result something went wrong in our prelink script, perhaps you can try to link the library manually.

@sujanbasnet
Copy link
Author

screen shot 2017-07-18 at 5 20 24 pm

This is my project structure, I don't know if its the default project structure or not, sorry for my naivety ( this is my first react native project and also my first android application ).

I did try manual installation from the wiki page but I can't seem to find the files you've mentioned in there. Even if I search for lets suppose android/app/build.gradle I get multiple files and I'm not sure which one to update, same case for settings.gradle and MainApplication.java

Again, I have very little idea about android and react native, I'm learning as I go.

@wkh237
Copy link
Owner

wkh237 commented Jul 19, 2017

okay, so looks like your using expo template. Please read refer to this issue.

@porteron
Copy link

porteron commented Oct 4, 2018

Is there an alternative that is compatible with expo?

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

No branches or pull requests

3 participants