EAS ios build fails (same commit builds if I eject first and submit bare project to EAS)

Failure when building managed app (in pre-build step): (build id: fade76e8-1264-44de-beb4-f4b7d2473a5d)

  • Config syncing
    [stderr] [10:28:06] [ios.dangerous]: withIosDangerousBaseMod: Could not find any application target in project.pbxproj
    [stderr] [10:28:06] Error: [ios.dangerous]: withIosDangerousBaseMod: Could not find any application target in project.pbxproj
    [stderr] at findFirstNativeTarget (/usr/local/eas-build-worker/node_modules/@expo/config-plugins/src/ios/Target.ts:80:11)

Same code, builds successfully if I eject locally, and then submit for EAS build as a bare project. (build id: 2775f8e3-9ebd-4f23-bdb6-db8a42f49bb7 )

Can you please help? I would prefer to keep it managed for longer if this issue could be resolved.

hi there! are you using the latest version of expo-cli locally? you can likely work around this for now by setting "expoCli" on your build profile to whichever version you are using locally. i’d really like to get an understanding of what is happening here, though.

  • please share expo diagnostics output.
  • please share the expo config --type prebuild output. redact any sensitive info, but please try to leave it as much in tact as possible
1 Like
Expo CLI 4.4.7 environment info:
    System:
      OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
      Shell: 4.4.20 - /bin/bash
    Binaries:
      Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
      Watchman: 20210131.142312.0 - /usr/local/bin/watchman
    npmPackages:
      expo: ~41.0.1 => 41.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2 
    npmGlobalPackages:
      expo-cli: 4.4.7
    Expo Workflow: managed

expo config:

{
  name: '*****',
  slug: '*****',
  version: '1.0.79',
  orientation: 'portrait',
  primaryColor: '#cccccc',
  icon: './assets/icon.png',
  scheme: '*****',
  assetBundlePatterns: [
    '**/*'
  ],
  plugins: [
    [
      'expo-notifications',
      {
        icon: './assets/pushicon.png',
        color: '#ffffff',
        sounds: [
          './assets/sounds/coin_drop_sm.wav',
          './assets/sounds/coin_notification.wav',
          './assets/sounds/mario_notification'
        ],
        mode: 'production'
      }
    ],
    'sentry-expo'
  ],
  description: undefined,
  sdkVersion: '41.0.0',
  platforms: [
    'ios',
    'android'
  ],
  currentFullName: '*****',
  splash: {
    image: './assets/splash.png',
    resizeMode: 'contain',
    backgroundColor: '#ffffff'
  },
  updates: {
    fallbackToCacheTimeout: 0
  },
  ios: {
    icon: './assets/iosicon.png',
    associatedDomains: [
      'applinks:*****'
    ],
    bundleIdentifier: '*****',
    googleServicesFile: './GoogleService-Info.plist',
    buildNumber: '1.0.79',
    supportsTablet: true,
    usesAppleSignIn: true,
    infoPlist: {
      NSCameraUsageDescription: '*****',
      NSPhotoLibraryUsageDescription: '*****'
    }
  },
  android: {
    googleServicesFile: './google-services.json',
    package: '*******',
    versionCode: 410010079,
    permissions: [
      'LOCATION',
      'CAMERA',
      'NOTIFICATIONS',
      'CAMERA_ROLL',
      'READ_INTERNAL_STORAGE',
      'READ_EXTERNAL_STORAGE',
      'WRITE_EXTERNAL_STORAGE'
    ],
    intentFilters: [
      {
        autoVerify: true,
        action: 'VIEW',
        data: [
          {
            scheme: 'https',
            host: '*******',
            pathPrefix: '/product'
          },
          {
            scheme: 'https',
            host: '*******',
            pathPrefix: '/signup'
          },
          {
            scheme: 'https',
            host: '*******',
            pathPrefix: '/alert'
          }
        ],
        category: [
          'BROWSABLE',
          'DEFAULT'
        ]
      }
    ],
    adaptiveIcon: {
      foregroundImage: './assets/adaptive-icon.png',
      backgroundColor: '#FFFFFF'
    }
  },
  notification: {
    icon: './assets/pushicon.png',
    color: '#ffffff'
  },
  web: {
    favicon: './assets/favicon.png',
    config: {
      firebase: {
        apiKey: '*******',
        authDomain: '*******',
        projectId: '*******',
        storageBucket: '*******',
        messagingSenderId: '*******',
        appId: '*******',
        measurementId: '*******'
      }
    }
  }
}

i still use the old cli, will try the build profile option, thanks for the suggestion

if you try expo prebuild locally with expo-cli@4.7.1 will you get the same error?

i am unable to reproduce the issue using parts of the config that you provided. could you try reproducing it on your machine and bisect the config that is responsible for this? maybe try removing all config except the bare minimum name/slug/bundleIdentifier and then add back piece by piece, running expo prebuild --platform -ios --clean each time

trying now, i had never done prebuilds till now, just used to call “eas build”…

it’s mostly the same as running expo eject

i submit builds through “eas build” though, now, expo prebuild changed package.json scripts

"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",

and changed a few packages:
from
“react-native”: “https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz”,
to
“react-native”: “~0.63.4”,

Do I check-in these?

And, now, when i I try to do “eas build”, I get “AssertionError: This function should be called only for managed projects Code: ERR_ASSERTION”
So, prebuild permanently ejects the project?

you should revert those changes before pushing again. i just want to see what combination of app.json config options in your project lead to the error message that you encountered on eas build. if you use the latest version of expo-cli locally, then i would expect that expo prebuild --platform ios --clean will produce the same error as you saw on eas build. so then you can simplify your app.json and re-run the process until you see what config is causing the problem. if you prefer, you can add me to the repo on github and i will do it - brentvatne

got it, with old expo-cli, prebuild finished successfully, and the xcode project file looks identical to the version that worked (ejected build). will install latest cli now and try prebuild.

1 Like

ok, with latest expo-cli, i see that the generated project.pbxproj is incomplete, it is missing sentry and firebase related entries. Sentry is probably causing it to fail somehow. I see the old cli auto added different set of dependent packages based on sentry vs. the newer cli importing different versions of the same packages (expo-updates, etc).

For now, i’ll use the old cli, will dig more this weekend and file a bug report for the new cli.
PM me your id, i can give you access to our repository if you wish (we use bitbucket, and it is a private repo)

Thanks for you help.