achorein / expo-share-intent

πŸš€ Simple share intent in an Expo Native Module
MIT License
128 stars 13 forks source link

Request for additional guidance on: TypeError: [ios.xcodeproj]: withIosXcodeprojBaseMod: Cannot read properties of null (reading 'path') #13

Closed davidcarboni closed 4 months ago

davidcarboni commented 4 months ago

Describe the bug I am experiencing the documented issue regarding a post-install script: TypeError: [ios.xcodeproj]: withIosXcodeprojBaseMod: Cannot read properties of null (reading 'path')

To Reproduce I am attempting to run: npx expo prebuild --no-install --clean

Environment give the output of the following command npx react-native info info Fetching system and libraries information... System: OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur) CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz Memory: 4.30 GB / 15.20 GB Shell: version: 5.2.15 path: /bin/bash Binaries: Node: version: 18.18.0 path: ~/.nvm/versions/node/v18.18.0/bin/node Yarn: version: 1.22.21 path: ~/.nvm/versions/node/v18.18.0/bin/yarn npm: version: 10.5.0 path: ~/.nvm/versions/node/v18.18.0/bin/npm Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: Not Found Ruby: Not Found npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.4 wanted: 0.73.4 npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: false

info React Native v0.73.5 is now available (your project is running on v0.73.4). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.73.5 info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.73.5 info For more info, check out "https://reactnative.dev/docs/upgrading?os=linux".

Additional context I have looked at the patch file but an not sure where to apply this change (I have searched under node_modules for files containing "xcode" to see if I could patch there but I haven't found the indicated line of code.

I have also looked at the linked issue and added the suggested override to my package.json however I still get the error message.

I'm really pleased to have found your package as I would love to be able to share URLs to my app. Any pointers you can offer will be very much appreciated!

achorein commented 4 months ago

:wave:

package resolution is not needed, the xcode dependency is already the latest.

the readme is not crystal clear about the require patch, can you try to follow these steps :

davidcarboni commented 4 months ago

Success! Thank you so much for taking the time to document this.

I applied the steps as you described and have successfiully run prebuild.

Fantastic work - your package has landed at the exact time I needed this solution, I'm very grateful for what you've created.

achorein commented 4 months ago

Your are welcome, i also updated the README πŸ‘

mcnaveen commented 1 month ago

Hi @achorein I'm doing the exact steps mentioned above and still facing issues.

yarn expo prebuild --no-install
yarn run v1.22.22
$ /Users/mcnaveen/Developer/shotix/node_modules/.bin/expo prebuild --no-install
βœ” Created native directories | reusing /android, /ios
βœ” Updated package.json | no changes
β ™ Running prebuild************ scheme shotix
βœ– Prebuild failed
TypeError: [ios.xcodeproj]: withIosXcodeprojBaseMod: Cannot read properties of null (reading 'path')
TypeError: [ios.xcodeproj]: withIosXcodeprojBaseMod: Cannot read properties of null (reading 'path')
    at correctForPath (/Users/mcnaveen/Developer/shotix/node_modules/xcode/lib/pbxProject.js:1682:38)
    at correctForResourcesPath (/Users/mcnaveen/Developer/shotix/node_modules/xcode/lib/pbxProject.js:1672:12)
    at pbxProject.addResourceFile (/Users/mcnaveen/Developer/shotix/node_modules/xcode/lib/pbxProject.js:258:9)
    at /Users/mcnaveen/Developer/shotix/node_modules/expo-config-plugin-ios-share-extension/build/withShareExtensionXcodeTarget.js:37:20
    at async action (/Users/mcnaveen/Developer/shotix/node_modules/expo-config-plugin-ios-share-extension/node_modules/@expo/config-plugins/build/plugins/withMod.js:235:23)
    at async interceptingMod (/Users/mcnaveen/Developer/shotix/node_modules/expo-config-plugin-ios-share-extension/node_modules/@expo/config-plugins/build/plugins/withMod.js:126:21)
    at async interceptingMod (/Users/mcnaveen/Developer/shotix/node_modules/@expo/config-plugins/build/plugins/withMod.js:104:21)
    at async interceptingMod (/Users/mcnaveen/Developer/shotix/node_modules/@expo/config-plugins/build/plugins/withMod.js:104:21)
    at async interceptingMod (/Users/mcnaveen/Developer/shotix/node_modules/@expo/config-plugins/build/plugins/withMod.js:104:21)
    at async interceptingMod (/Users/mcnaveen/Developer/shotix/node_modules/@expo/config-plugins/build/plugins/withMod.js:104:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.