react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Issue with running React Native project on iOS

Open MichelaM2001 opened this issue 11 months ago • 5 comments

Description

Hello,

I'm currently facing an issue while trying to run my React Native project on iOS. I have followed the necessary steps, but I keep encountering an error during the build process. I have tried various troubleshooting steps, such as updating dependencies, cleaning the project, and verifying my environment setup. However, I haven't been able to resolve the issue so far.

I would greatly appreciate any assistance or guidance on how to resolve this problem. If anyone has encountered a similar issue or has any suggestions, please feel free to contribute to the discussion.

Thank you in advance for your help!

The log: 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '/Users/ns12/.nvm/versions/node/v14.17.3/bin/node', 1 verbose cli '/Users/ns12/.nvm/versions/node/v14.17.3/bin/npm', 1 verbose cli 'run', 1 verbose cli 'ios' 1 verbose cli ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'preios', 'ios', 'postios' ] 5 info lifecycle [email protected]~preios: [email protected] 6 info lifecycle [email protected]~ios: [email protected] 7 verbose lifecycle [email protected]~ios: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~ios: PATH: /Users/ns12/.nvm/versions/node/v14.17.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/ns12/Documents/geocamere-app/node_modules/.bin:/Users/ns12/.nvm/versions/node/v14.17.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ns12/.nvm/versions/node/v14.17.3/bin 9 verbose lifecycle [email protected]~ios: CWD: /Users/ns12/Documents/geocamere-app 10 silly lifecycle [email protected]~ios: Args: [ '-c', 'expo run:ios' ] 11 silly lifecycle [email protected]~ios: Returned: code: 1 signal: null 12 info lifecycle [email protected]~ios: Failed to exec ios script 13 verbose stack Error: [email protected] ios: expo run:ios 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/Users/ns12/.nvm/versions/node/v14.17.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:375:28) 13 verbose stack at ChildProcess. (/Users/ns12/.nvm/versions/node/v14.17.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:375:28) 13 verbose stack at maybeClose (internal/child_process.js:1055:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) 14 verbose pkgid [email protected] 15 verbose cwd /Users/ns12/Documents/geocamere-app 16 verbose Darwin 21.6.0 17 verbose argv "/Users/ns12/.nvm/versions/node/v14.17.3/bin/node" "/Users/ns12/.nvm/versions/node/v14.17.3/bin/npm" "run" "ios" 18 verbose node v14.17.3 19 verbose npm v6.14.13 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] ios: expo run:ios 22 error Exit status 1 23 error Failed at the [email protected] ios script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

React Native Version

0.71.3

Output of npx react-native info

System: OS: macOS 12.6.7 CPU: (12) x64 Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz Memory: 624.73 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.14.13 - ~/.nvm/versions/node/v14.17.3/bin/npm Watchman: 2023.07.10.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 13.2/13C90 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.3 => 0.71.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

run npm run ios on a react native project

Snack, code example, screenshot, or link to a repository

No response

MichelaM2001 avatar Jul 12 '23 13:07 MichelaM2001

:warning: Add or Reformat Version Info
:information_source: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2

github-actions[bot] avatar Jul 12 '23 13:07 github-actions[bot]

I'm not sure but in the latest releases they added this to package.json

  "engines": {
    "node": ">=16"
  }

so try use a higher version of node and give it a try

saif-o99 avatar Jul 12 '23 15:07 saif-o99

I'm not sure but in the latest releases they added this to package.json

  "engines": {
    "node": ">=16"
  }

so try use a higher version of node and give it a try

Now it doesn't give me that log anymore but there's still the error: CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.

MichelaM2001 avatar Jul 12 '23 15:07 MichelaM2001

Experiencing the same error 65. In desperation I even create a blank app via the cli and it builds and lauches for IOS in the simulator as well as in Azure ci for production but I am unable to build a development version for TestFlight with following:

pool: vmImage: 'macos-latest'

steps:

  • checkout: self persistCredentials: true clean: true

  • task: NodeTool@0 displayName: 'Install Node' inputs: versionSpec: '16.20.1' # you can use your desired version here

  • script: yarn install displayName: Install Dependencies

  • script: |

    Disable autocommit on version bump

    yarn config set version-sign-git-tag false yarn config set version-git-tag false yarn config set version-commit-hooks false

    Checkout branch where the build is triggered

    git checkout $(Build.SourceBranchName)

    Extract existing version of package.json

    oldVer=$(jq -r ".version" package.json)

    Bump version

    yarn version --patch

    Add bumped version to staging

    git add *

    Extract new version of package.json

    newVer=$(jq -r ".version" package.json)

    Set environment variables

    echo "##vso[task.setvariable variable=OLD_VERSION]$oldVer" echo "##vso[task.setvariable variable=NEW_VERSION]$newVer" displayName: 'Bump version and set variables'

  • task: ios-bundle-version@1 displayName: 'Bump iOS version' inputs: sourcePath: 'ios/myapp/Info.plist' versionCodeOption: 'buildid' versionCode: '$(Build.BuildId)' versionName: '$(NEW_VERSION)' printFile: false

  • script: | tag="mobile_$(NEW_VERSION)" echo "New tag $tag" git add * git commit -m "Update version from $(OLD_VERSION) to $(NEW_VERSION) [skip ci]" git tag $tag git pull --rebase origin $(Build.SourceBranchName) git push origin $(Build.SourceBranchName) git push --tags displayName: Bump commit

  • task: InstallAppleCertificate@2 displayName: Install Apple Certificate inputs: certSecureFile: 'Certificate.p12' certPwd: '$(AppleCertificatePassword)' keychain: 'temp' deleteCert: true

  • task: InstallAppleProvisioningProfile@1 displayName: 'Install Apple Provisioning Profile' inputs: provisioningProfileLocation: 'secureFiles' provProfileSecureFile: 'mobile_profile.mobileprovision' removeProfile: true

  • task: CocoaPods@0 displayName: 'Install CocoaPods' inputs: workingDirectory: 'ios'

  • task: Xcode@5 displayName: 'Build IPA' inputs: actions: build configuration: 'Debug' sdk: 'iphoneos' xcWorkspacePath: 'ios/myapp.xcworkspace' scheme: 'myapp' packageApp: true exportPath: 'output' signingOption: 'manual' signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)' provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

juanreynolds avatar Aug 07 '23 14:08 juanreynolds

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 04 '24 05:02 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Feb 11 '24 05:02 github-actions[bot]