React-native: Something went wrong while linking. Error: Cannot read property 'pbxprojPath' of null

Created on 25 Apr 2018  路  28Comments  路  Source: facebook/react-native

I get this error when i run react-native link in my project root

RNFetchBlob checking app version ..
RNFetchBlob detected app version => 0.54
Add Android permissions => false
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

rnpm-install info Linking assets to ios project
rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'pbxprojPath' of null
Please file an issue here: https://github.com/facebook/react-native/issues

Cannot read property 'pbxprojPath' of null

Environment

OS: Windows 10
Node: 8.11.1
Yarn: Not Found
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.0.0.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: ^0.55.3 => 0.55.3

Steps to Reproduce

I cant really reproduce the issue but this is my dependecies
"dependencies": {
"expo": "^26.0.0",
"native-base": "^2.4.1",
"react": "16.3.0-alpha.1",
"react-native": "0.54.0",
"react-native-elements": "^0.19.1",
"react-native-fetch-blob": "^0.10.8",
"react-native-fit-image": "^1.5.4",
"react-native-htmlview": "^0.12.1",
"react-native-modal": "^5.4.0",
"react-native-pdf": "^3.0.6",
"react-native-photo-upload": "^1.2.0",
"react-native-theme": "^0.1.8",
"react-native-timeago": "^0.4.0",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^1.5.9",
"react-pdf": "^3.0.4"
}

Expected Behavior

I expected the project to link successfully

Locked

Most helpful comment

I ended up running react-native upgrade, afterwards an iOS and android folder appeared and my issues were gone

All 28 comments

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

Thank you for your contributions.

Also having this issue. Trying to link react-native-device-info using react-native@~0.54.1.

I updated my react native to 0.54 still getting the same error

yep getting the same issue here @~0.54.1

Not sure if that's the case for you all, but it's not possible to link native dependencies using Expo. I've re-created my app using react-native init instead of create-react-native-app and then everything works just fine. (More info: https://github.com/react-community/create-react-native-app/issues/516)

I ended up running react-native upgrade, afterwards an iOS and android folder appeared and my issues were gone

same issue hiere. With 0.55 and 0.54

Same problem here but as @tehzwen mentioned, running react-native upgrade did the trick

I had to stick to old library versions and now its working.

I realized that in my case I used create-react-native-app instead of react-native init and i was trying to use libraries which require native code to work. So i do not think i need react-native link

Same for me. I was already using 0.55.2, but after ran the upgrade, I was able to use react-native link successfully.

react-native upgrade works for me

Running react-native upgrade then react-native link worked for me as well

For clarity for anyone else new to react native like me, I'd done the following to create my project and using react paper vector icons, which gave the error above:

npm install -g create-react-native-app
npm install -g react-native-cli (if I didn't do this, I always got errors trying to link)
create-react-native-app myReactNativePaperProject
cd myReactNativePaperProject
npm install react-native-vector-icons --save
react-native link react-native-vector-icons

Then, I did this to resolve the link issue:

react-native upgrade (I chose yes on the prompts that followed)
npm install react-native-vector-icons --save (probably not necessary, but I did it in case.)
react-native link react-native-vector-icons

Thankyou all for your help!

Run react-native link react-native-maps this works

Error from react-native link

rnpm-install info Linking assets to ios project
rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'pbxprojPath' of null
Please file an issue here: https://github.com/facebook/react-native/issues

Cannot read property 'pbxprojPath' of null.

Then after running react-native upgrade, worked fine.

Linking is only possible if you created a project using react-native init command, because it involved native code. Read https://facebook.github.io/react-native/docs/getting-started#caveats

I was using Expo and as it's mentioned before, only running "react-native upgrade" first and then "react-native link" and it worked.

"react-native upgrade" worked for me to, thanks!!

react-native upgrade also worked for me 馃樃

The same, it worked for me :) Thanks!

react-native upgrade did not work for me. So annoying. Sitting with this problem for 1 hour

I used Expo to init my project and ran into this issue. react-native upgrade wasn't working because Expo used their archived repo version of react-native in package.json
"https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz"

To fix:

yarn remove react-native
yarn add react-native

Be sure to NOT replace app.json when prompted, or that will break Expo.

You might be facing an issue with react-native upgrade saying that your react-native version in package.json is different than the one in node_modules
fix:

npm update

then you can use react-native upgrade. It is advised by facebook to use react-native-git-upgrade
the version conflict might come when using expo

This is not an problem that should be solved by react-native upgrade, if possible an uninstall and reinstall at the exact version would be better. Then this can be confirmed as a react native bug.

I too confirmed react-native upgrade did the trick - I had to say no to a lot of stuff in my ios project on the prompt.

go to your package.json => add property name file (ex "name":"blabla") => react-native upgrade => react-native link => et voilaa

npm update should work then react-native link

Was this page helpful?
0 / 5 - 0 ratings

Related issues

despairblue picture despairblue  路  3Comments

josev55 picture josev55  路  3Comments

oney picture oney  路  3Comments

TrakBit picture TrakBit  路  3Comments

lazywei picture lazywei  路  3Comments