Cannot read property 'assetsPath' of null (react-native link)
See original GitHub issueEnvironment
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:
- Created 6 years ago
- Reactions:6
- Comments:12 (1 by maintainers)
@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 ranreact-native link
everything went fine. I hope this helps!In my case I’m developing an iOS only project in a subdirectory
/ios
. When I ranreact-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 withandroid/src/main/AndroidManifest.xml
: https://developer.android.com/guide/topics/manifest/manifest-intro.html.Also opened a PR with fix: #18660