Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-manifest-ios.sh Bundle Expo Assets fails via on GITHUB Actions/ using Fastlane #8691

Closed
thedarkcder opened this issue Jun 5, 2020 · 13 comments
Assignees
Labels
Bare Workflow iOS needs more info To be used when awaiting reporter response Updates

Comments

@thedarkcder
Copy link

Running script 'Bundle Expo Assets'
13377
    the transform cache was reset.
13378
    The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.4.99. (in target 'Fabric' from project 'Pods')
13379
    The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.4.99. (in target 'Crashlytics' from project 'Pods')
13380
** ARCHIVE FAILED **
13381

13382

13383
The following build commands failed:
13384
	PhaseScriptExecution Bundle\ Expo\ Assets /Users/runner/Library/Developer/Xcode/DerivedData/bsket-gpjqpcghdwzdmyfqttipqhmuklfm/Build/Intermediates.noindex/ArchiveIntermediates/bsket/IntermediateBuildFilesPath/bsket.build/Release-iphoneos/bsket.build/Script-00DD1BFF1BD5951E006B06BC.sh
13385
(1 failure)
13386
ERROR [2020-06-05 14:07:49.20]: Exit status: 65

Latest CLi is is installed on the build server via https://github.com/expo/expo-github-action

package json

{
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/samples": "~3.0.3",
    "@expo/vector-icons": "^10.0.0",
    "@mapbox/polyline": "^1.1.0",
    "@react-native-community/async-storage": "^1.8.0",
    "@react-native-community/netinfo": "5.5.1",
    "@react-native-community/viewpager": "3.3.0",
    "@react-native-firebase/app": "^7.1.0",
    "@react-native-firebase/crashlytics": "^7.1.0",
    "@react-navigation/web": "^1.0.0-alpha.9",
    "@types/lodash": "^4.14.149",
    "add": "^2.0.6",
    "axios": "^0.19.2",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "date-fns": "^2.13.0",
    "expo": "^37.0.12",
    "expo-asset": "~8.1.5",
    "expo-blur": "~8.1.0",
    "expo-constants": "^9.0.0",
    "expo-device": "~2.1.0",
    "expo-font": "~8.1.0",
    "expo-localization": "^8.1.0",
    "expo-notifications": "^0.1.7",
    "expo-sharing": "~8.1.0",
    "expo-splash-screen": "^0.2.3",
    "expo-updates": "~0.2.7",
    "expo-web-browser": "~8.2.0",
    "geolib": "^3.2.1",
    "i18n-js": "^3.5.1",
    "javascript-time-ago": "^2.0.7",
    "moment": "^2.24.0",
    "native-base": "2.13.8",
    "net": "^1.0.2",
    "prop-types": "^15.7.2",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "~0.61.5",
    "react-native-credit-card-input": "^0.4.1",
    "react-native-dimension": "^1.0.6",
    "react-native-elements": "^1.2.6",
    "react-native-fast-image": "^8.1.5",
    "react-native-gesture": "^0.2.0",
    "react-native-gesture-handler": "~1.6.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-keychain": "^6.0.0",
    "react-native-loading-spinner-overlay": "^1.1.0",
    "react-native-localize": "^1.4.0",
    "react-native-maps": "0.27.1",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-material-textfield": "^0.16.1",
    "react-native-orientation": "^3.1.3",
    "react-native-picker-select": "^6.3.2",
    "react-native-push-notification": "^3.1.9",
    "react-native-rate": "^1.2.1",
    "react-native-reanimated": "~1.7.0",
    "react-native-screens": "~2.2.0",
    "react-native-snap-carousel": "^3.9.0",
    "react-native-svg": "11.0.1",
    "react-native-swiper": "^1.6.0-rc.3",
    "react-native-unimodules": "~0.9.0",
    "react-native-vector-icons": "^6.6.0",
    "react-native-web": "~0.11.7",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.10.3",
    "react-navigation-tabs": "^2.7.0",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-axios-middleware": "^4.0.1",
    "redux-devtools-extension": "^2.13.7",
    "redux-immutable": "^4.0.0",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-persist-transform-encrypt": "^2.0.1",
    "redux-promise": "^0.6.0",
    "redux-saga": "^0.15.3",
    "redux-thunk": "^2.3.0",
    "rn-sliding-up-panel": "^2.4.0",
    "sockjs-client": "^1.4.0",
    "stompjs": "^2.3.3",
    "throttle-debounce": "^2.1.0",
    "tipsi-stripe": "https://github.com/tipsi/tipsi-stripe.git#experimental",
    "validate.js": "^0.13.1"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "babel-jest": "~25.2.6",
    "babel-preset-expo": "^8.1.0",
    "jest": "~25.2.6",
    "react-native-keyboard-spacer": "^0.4.1",
    "react-native-svg-transformer": "^0.14.3",
    "react-test-renderer": "~16.9.0",
    "typescript": "^3.8.3"
  },
  "private": true
}

Tried removing create-manifest-ios.sh from the build phase but the app doesn't start due to it not finding the bundle.

@byCedric
Copy link
Member

byCedric commented Jun 5, 2020

Hi @thedarkcder! What is the Github action configuration you are using? I'm not sure if you need the Expo CLI installed, because it looks like you are using the bare workflow? Or are you trying to push a new update on GH actions?

@byCedric byCedric added Bare Workflow iOS needs more info To be used when awaiting reporter response Updates labels Jun 5, 2020
@thedarkcder
Copy link
Author

thedarkcder commented Jun 5, 2020

I guess i am following advice from https://forums.expo.io/t/expo-bare-app-center-build/36472/8

name: Expo Publish Stage

on:
  push:
    branches:
      - develop
jobs:
  publish:
    runs-on: macOS-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12.x
      - uses: expo/expo-github-action@v5
        with:
          expo-version: 3.x
          expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
          expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
          expo-cache: true
      - run: yarn install
      - run: |
          brew install xcodegen
          xcodegen generate
      - name: Run fastlane setup
        env:
          APPLE_ACCOUNT: ${{ secrets.APPLE_ACCOUNT }}
          TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
          XCODE_PROJECT:  ${{ secrets.XCODE_PROJECT }}
          LANG: en_GB.UTF-8
          LC_ALL: en_GB.UTF-8
        run: |
          fastlane ios setup --verbose
      - name: Run fastlane ios build
        env:
          MATCH_REPO: ${{ secrets.MATCH_REPO }}
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
          XCODE_PROJECT:  ${{ secrets.XCODE_PROJECT }}
          APPLE_CODE_SIGNING_IDENTITY: ${{ secrets.APPLE_CODE_SIGNING_IDENTITY }}
          APPLE_ACCOUNT: ${{ secrets.APPLE_ACCOUNT }}
          TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
          FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
          LANG: en_GB.UTF-8
          LC_ALL: en_GB.UTF-8
        run: |
         fastlane ios compile --verbose
      - name: Run fastlane deploy
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
          LANG: en_GB.UTF-8
          LC_ALL: en_GB.UTF-8
        run: fastlane ios deploy --verbose
        
      - name: Create android keystore
        run: |
          mkdir ./fastlane/keys
          echo "${{ secrets.KEYSTORE_FILE_B64 }}" | base64 -D > ./fastlane/keys/mobile.keystore
      - name: fastlane android alpha
        env:
          KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
          KEYSTORE_ALIAS_PASSWORD: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
          KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
          PLAYSTORE_JSON_KEY_DATA: ${{ secrets.PLAYSTORE_JSON_KEY_DATA }}
          LANG: en_GB.UTF-8
          LC_ALL: en_GB.UTF-8
        run: fastlane android alpha --verbose

a bit dirty

Edit: Yes bare workflow, trying to build the bundle before deploying. Works fine on my machine but seems to have a problem on a CI machine.

@benfontan
Copy link

benfontan commented Jun 25, 2020

Same issue here. It seems related to expo-updates waiting for packager server which is not started during build. It is working in local only when running npm start or react-native start at the same time.

Error: Failed to connect to the packager server. If you did not start this build by running 'react-native run-android', you can start the packager manually by running 'react-native start' in the project directory. (Error: Request to packager server failed: 500)
    at /Users/xxx/actions-runner/_work/xxx/xxx/node_modules/expo-updates/scripts/createManifest.js:40:11
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Command PhaseScriptExecution failed with a nonzero exit code

@halfmatthalfcat
Copy link

Can confirm I'm also running into this issue with the bare workflow on Github's macos runner.

@alex-mironov
Copy link

alex-mironov commented Jul 7, 2020

Any idea how to fix it? Why is this step needed at all?

	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/runner/Library/Developer/Xcode/DerivedData/myapp/Build/Intermediates.noindex/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/Script-.....sh
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
##[section]Finishing: Xcode build (signed)```

@thedarkcder
Copy link
Author

Any ideas @byCedric ?

@alex-mironov
Copy link

alex-mironov commented Jul 8, 2020

Screen Shot 2020-07-08 at 10 51 07

Can someone pls describe what `create-manifest-ios.sh` is supposed to do?

The Archive doesn't work without running the packager. Is it how it's supposed to be? I'm using bare workflow.

@angelmiy
Copy link

We are also seeing the same errors in pipelines

[09:58:27]: ▸ ** TEST BUILD FAILED **
[09:58:27]: ▸ The following build commands failed:
[09:58:27]: ▸ 	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/runner/work/1/s/ios/build/Build/Intermediates.noindex/prospa.build/Debug-iphonesimulator/Prospa.build/Script-00DD1BFF1BD5951E006B06BC.sh
[09:58:27]: ▸ (1 failure)

after updating to Expo 38

@changLiuUNSW
Copy link
Contributor

changLiuUNSW commented Jul 13, 2020

I have exactly the same issue in CI.
For IOS, I use fastlane scan to build the app for testing:

 private_lane :build_for_testing do |options|
        clear_build_dir
        ['Bin', 'Logs/Test/Results', 'Reports'].each {
            |dir| FileUtils.mkdir_p "#{build_directory}/#{dir}"
        }

        options[:scheme]

        xcode_test_results_dir = File.join(build_directory, 'Logs', 'Test', 'Results', options[:scheme])
        FileUtils.mkdir_p(xcode_test_results_dir)
        xcode_test_reports_dir = File.join(build_directory, 'Reports')

        scan(
            scheme: options[:scheme],
            workspace: workspace,
            device: test_device,
            skip_build: true,
            build_for_testing: true,
            clean: true,
            derived_data_path: build_directory,
            result_bundle: xcode_test_results_dir,
            output_directory: xcode_test_reports_dir,
            buildlog_path: File.join(build_directory, 'Logs')
        )
    end

I got below error:

[09:58:27]: ▸ ** TEST BUILD FAILED **
[09:58:27]: ▸ The following build commands failed:
[09:58:27]: ▸ 	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/runner/work/1/s/ios/build/Build/Intermediates.noindex/prospa.build/Debug-iphonesimulator/Prospa.build/Script-00DD1BFF1BD5951E006B06BC.sh
[09:58:27]: ▸ (1 failure)

For Android, I use fastlane gradle task assemble for release build:

    private_lane :build do |options|
        UI.user_error! "You must specify a build_type. ie. build_type:'debug'" if options[:build_type].to_s.empty?

        version_code = ENV["BUILD_BUILDNUMBER"]
        increment_version_code(app_project_dir: app_directory, version_code: version_code)

        gradle(
            task: 'assemble',
            build_type: 'release',
            project_dir: project_directory
        )
    end

I got below error:

> Task :app:createReleaseExpoManifest
Error: Failed to connect to the packager server. If you did not start this build by running 'react-native run-android', you can start the packager manually by running 'react-native start' in the project directory. (Error: connect ECONNREFUSED 127.0.0.1:8081)
    at /Users/runner/work/1/s/node_modules/expo-updates/scripts/createManifest.js:40:11
    at process._tickCallback (internal/process/next_tick.js:68:7)

@alex-mironov
Copy link

I ended up removing expo-updates as I was not actually using them. Obviously that fixes the issue https://github.com/expo/expo/blob/master/packages/expo-updates/README.md#removing-pre-installed-expo-updates

@halfmatthalfcat
Copy link

It looks like the create-manifest script needs to startup the bundler, just as the react-native xcode.sh script does. Unless you can find a way to run the bundler separately in another process...but in a CI environment that's a bit tricky as we're seeing.

@thedarkcder
Copy link
Author

thedarkcder commented Jul 15, 2020

This is used, (if you are using bare workflow) to build the JS asset manifest. The manifest previously built using expo publish CMD. I wasn't able to identify why the built process isn't able to spawn another process as I don't have a test box.

Few key points. The android build script seems to be very temperamental and doesn't always launch the metro builder. For me to get the complete c.i build working (Android +iOS ) I must start the iOS build first. This seems to work using an interactive service (local machine using a self hosted runner )

That being said I'm going to assume that the issue here is permissions to spawn a child process in a non interactive shell.

If anybody ha a dedicated c.i and can share the event logs I might be able to solve it. Most likely it's a service shell permissions.

Will check this out when I have time

@brentvatne
Copy link
Member

this should be fixed in expo-updates@0.2.12, please let me know if the issue persists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bare Workflow iOS needs more info To be used when awaiting reporter response Updates
Projects
None yet
Development

No branches or pull requests

9 participants