question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'assetsPath' of null (react-native link)

See original GitHub issue

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 8.6.0 Yarn: 1.2.1 npm: 5.3.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found

Packages: (wanted => installed) react: ^16.2.0 => 16.2.0 react-native: ^0.54.0 => 0.54.0

Expected Behavior

Should link all native libs.

Actual Behavior

react-native-link tells me that all libs are linked (as they are), but at the end there is a “linking assets…” that seems to go wrong.

I get Cannot read property 'assetsPath' of null

Update: I get the same error when I try to unlink a library, i.e.: react-native unlink react-native-vector-icons

gives me:

rnpm-install info Unlinking react-native-vector-icons ios dependency
rnpm-install info Platform 'ios' module undefined has been successfully unlinked
rnpm-install info Unlinking assets from ios project
rnpm-install info Unlinking assets from android project
rnpm-install ERR! It seems something went wrong while unlinking. Error: Cannot read property 'assetsPath' of null

Steps to Reproduce

I upgraded from RN 0.51 to 0.54 via react-native-git-upgrade. I was told there where conflicts in the project file, but I didn’t find any conflicts.

The project itself does not run after upgrade to 0.54. This is as usual when I try to upgrade RN. after some tinkering it usually starts to work, but not this time. I suspect the “assetsPath” to be the problem.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
michaelsyapcommented, Mar 19, 2018

@msageryd I had the same issue as you however I realized that I wasn’t in my react native project directory when I ran react-native link. When I went into the directory then ran react-native link everything went fine. I hope this helps!

2reactions
thejchapcommented, Apr 2, 2018

In my case I’m developing an iOS only project in a subdirectory /ios. When I ran react-native link the CLI was trying to also link to a nonexistent Android project in /android. Quick fix for me was adding that folder and some of the basic Android config files it was looking for starting with android/src/main/AndroidManifest.xml: https://developer.android.com/guide/topics/manifest/manifest-intro.html.

Also opened a PR with fix: #18660

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of null React - Stack Overflow
I think the issue is with this line story['mData']['mMessage'] Since story is going to be null initially and we are trying to access...
Read more >
cannot read property of null (reading 'children') npm install
The error message means that npm is trying to read the version property of the folder's package.json file but doesn't find the file....
Read more >
react-native-pdf - npm
A react native PDF view component, support ios and android platform. ... read a PDF from url, blob, local file or asset and...
Read more >
TypeError: Cannot read property 'uid' of null-React Native
Coding example for the question TypeError: Cannot read property 'uid' of null-React Native.
Read more >
Error while loading loading map. - Page 2 - Esri Community
... id: 'gray-vector') TypeError: t is not a constructor Zoom.js:5 Uncaught (in promise) TypeError: Cannot read property 'zoomIn' of null.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found