Skip to content

iOS contributing documentation missing or incomplete **many issues**

I've been trying to go through the contributing documentation to set up my environment for iOS development, and I have found some issues that I would like to highlight in this issue to find a way to solve them and fix them.

- Only Android development

The first issue I found was the fact that the documentation seems to be written only for Android development. While this is not necessarily a problem, I had to read the guide entirely before understanding that I have to follow the Android instructions and try to apply the to iOS if I wanted to set up my environment because there are no "specific" iOS guidelines to follow.

- Not Android or iOS specifics

Trying to follow the Android commands and adjust them to iOS won't work either, because there are specific React Native and nodejs-mobile stuff you need to do to make these commands to work. Still, that part of the guide is inside a section called "Android specifics" which I didn't follow until I try to set up the environment for Android development.

- Command --variant=indieDebug throws an error for iOS

I'm not a React Native developer myself, so I don't know if this flag is required only for Android, and we have a different one for iOS. The only thing I know is that it is not working, so I have to run the react-native run-ios command without the flag (notice how that command is not specified in the doc either).

- Missing pod install command

This might be something obvious for the average React Native developer but it took me some time to figure out that I was missing the Cocoapods dependency installation, which has to be done by running the command pod install in the ./ios directory. Again, this is not documented.

- Can't build on device

Last but not least I'd like to notice that I haven't been able to find a way to run the application in my device for development. I already have an Apple's developer account properly configure, I have my devices registered, and I made the changes in Xcode to use my account and my devices with the project but every time I run react-native run-ios the project tries to load the application in the simulator.

- iOS build error

After figuring out the Cocoapods "issue" the project compilation seems to start running correctly after some intensive log of node processes start to appear ending in some errors that I haven't figure out what they mean.

I would like to highlight the line warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'ManyverseTests' from project 'Manyverse') which I haven't been able to solve not even changing the target or the valid architectures in Xcode.

This is the last part of the log:

make: *** No rule to make target `/Users/user/Development/personal/manyverse/ios/build/Manyverse/Build/Products/Debug-iphonesimulator/Manyverse.app/nodejs-project/node_modules/sodium-native-nodejs-mobile/lib/ios/libsodium.so', needed by `Release/libsodium.so'.  Stop.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/home/Development/personal/manyverse/node_modules/nodejs-mobile-gyp/lib/build.js:248:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/home/.nvm/versions/node/v10.13.0/bin/node" "/Users/home/Development/personal/manyverse/node_modules/nodejs-mobile-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Products/Debug-iphonesimulator/Manyverse.app/nodejs-project/node_modules/sodium-native-nodejs-mobile
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v0.3.1
gyp ERR! not ok
npm verb lifecycle sodium-native-nodejs-mobile@2.4.2-30~install: unsafe-perm in lifecycle true
npm verb lifecycle sodium-native-nodejs-mobile@2.4.2-30~install: PATH: /Users/home/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Products/Debug-iphonesimulator/Manyverse.app/nodejs-project/node_modules/sodium-native-nodejs-mobile/node_modules/.bin:/Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Products/Debug-iphonesimulator/Manyverse.app/nodejs-project/node_modules/.bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Users/home/Development/personal/manyverse/node_modules/.bin:/usr/local/sbin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/home/.pyenv/shims:/usr/local/opt/libxml2/bin:/opt/local/bin:/opt/local/sbin:/Users/home/.local/bin:/Users/home/.cargo/bin:/Users/home/.rvm/gems/ruby-2.3.0/bin:/Users/home/.rvm/gems/ruby-2.3.0@global/bin:/Users/home/.rvm/rubies/ruby-2.3.0/bin:/Users/home/.nvm/versions/node/v10.13.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Users/home/.rvm/bin:/Users/home/Library/Android/sdk/emulator:/Users/home/Library/Android/sdk/tools:/Users/home/Library/Android/sdk/tools/bin:/Users/home/Library/Android/sdk/platform-tools
npm verb lifecycle sodium-native-nodejs-mobile@2.4.2-30~install: CWD: /Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Products/Debug-iphonesimulator/Manyverse.app/nodejs-project/node_modules/sodium-native-nodejs-mobile
npm info lifecycle sodium-native-nodejs-mobile@2.4.2-30~install: Failed to exec install script
npm verb stack Error: sodium-native-nodejs-mobile@2.4.2-30 install: `node-gyp-build "node preinstall.js" "node postinstall.js"`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/Users/home/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:182:13)
npm verb stack     at ChildProcess.<anonymous> (/Users/home/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:182:13)
npm verb stack     at maybeClose (internal/child_process.js:962:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
npm verb pkgid sodium-native-nodejs-mobile@2.4.2-30
npm verb cwd /Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Products/Debug-iphonesimulator/Manyverse.app/nodejs-project
npm verb Darwin 18.7.0
npm verb argv "/Users/home/.nvm/versions/node/v10.13.0/bin/node" "/Users/home/.nvm/versions/node/v10.13.0/bin/npm" "--verbose" "rebuild" "--build-from-source"
npm verb node v10.13.0
npm verb npm  v6.13.7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sodium-native-nodejs-mobile@2.4.2-30 install: `node-gyp-build "node preinstall.js" "node postinstall.js"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sodium-native-nodejs-mobile@2.4.2-30 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 34390ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/home/.npm/_logs/2020-03-01T14_36_31_290Z-debug.log
Command PhaseScriptExecution failed with a nonzero exit code

warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'ManyverseTests' from project 'Manyverse')

2020-03-01 09:34:02.688 XCBBuildService[3462:3831082] Failed to remove: /Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Intermediates.noindex/XCBuildData/afc6229bb863f01d80e33bbb2bea61a5-desc.xcbuild: unlink(/Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Intermediates.noindex/XCBuildData/afc6229bb863f01d80e33bbb2bea61a5-desc.xcbuild): No such file or directory (2)
** BUILD FAILED **


The following build commands failed:
	PhaseScriptExecution [CP-User]\ [NODEJS\ MOBILE]\ Build\ Native\ Modules /Users/home/Development/personal/manyverse/ios/build/Manyverse/Build/Intermediates.noindex/Manyverse.build/Debug-iphonesimulator/Manyverse.build/Script-C545F6F8057E4185F2270600.sh
(1 failure)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information