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

Error building on iOS when using app.config.ts #24061

Closed
e-lucas-gestao opened this issue Aug 22, 2023 · 5 comments
Closed

Error building on iOS when using app.config.ts #24061

e-lucas-gestao opened this issue Aug 22, 2023 · 5 comments
Labels
CLI Versioned Expo CLI -- `npx expo start` stale

Comments

@e-lucas-gestao
Copy link

Summary

I'm trying to replace my app.json with an app.config.ts to dynamically control those fields in my app, but when I try to build it on IOS I get the following errors:

Configure xCodeProject

Configuring Xcode project
Assigning provisioning profile '*[expo] com.company.app-name AppStore 2022-12-21T12:52:36.574Z' (Apple Team ID: 4N33TWWTD9) to target 'AppName'
Could not find target 'AppName' in project.pbxproj

Fail build

Could not find target 'AppName' in project.pbxproj ```

### What platform(s) does this occur on?

_No response_

### SDK Version

49.0.3

### Environment

``` expo-env-info 1.0.5 environment info:
    System:
      OS: Linux 6.3 Artix Linux
      Shell: 5.9 - /usr/bin/zsh
    Binaries:
      Node: 19.4.0 - ~/.nvm/versions/node/v19.4.0/bin/node
      Yarn: 1.22.19 - /usr/bin/yarn
      npm: 9.8.1 - /usr/bin/npm
    SDKs:
      Android SDK:
        API Levels: 29, 31, 33
        Build Tools: 29.0.2, 30.0.3, 31.0.0, 33.0.0, 33.0.1
        System Images: android-28 | Google Play Intel x86 Atom, android-33 | Google APIs Intel x86 Atom_64
    IDEs:
      Android Studio: AI-222.4459.24.2221.10121639
    npmGlobalPackages:
      eas-cli: 3.13.0
      expo-cli: 6.3.10
    Expo Workflow: managed

Minimal reproducible example

Here is my ts.config.ts:

import { ExpoConfig, ConfigContext } from 'expo/config';

const isProduction = process.env.EXPO_PUBLIC_ENVIRONMENT === 'production'

export default ({ config }: ConfigContext): ExpoConfig => ({
  ...config,
  name: isProduction ? "App Name - Production" : "App Name - Preview",
  owner: "company",
  slug: "appname",
  version: "2.2.5",
  orientation: "portrait",
  icon: "./assets/icon.png",
  userInterfaceStyle: "light",
  splash: {
    image: "./assets/logo.png",
    resizeMode: "contain",
    backgroundColor: "#ffffff"
  },
  updates: {
    fallbackToCacheTimeout: 0,
    url: "https://u.expo.dev/aae3bb74-90f1-45a2-a113-15bbe9b9a241"
  },
  assetBundlePatterns: [
    "**/*"
  ],
  ios: {
    bundleIdentifier: isProduction ? "com.company.appname" : "com.preview.appname",
    buildNumber: "2"
  },
  android: {
    versionCode: 6,
    adaptiveIcon: {
      foregroundImage: "./assets/adaptive-icon.png",
      backgroundColor: "#1a4f9f"
    },
    package: isProduction ? "com.company.appname" : "com.preview.appname"
  },
  web: {
    favicon: "./assets/favicon.png"
  },
  extra: {
    eas: {
      projectId: "idfromproject"
    }
  },
  runtimeVersion: {
    policy: "sdkVersion"
  }
});
@e-lucas-gestao e-lucas-gestao added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels Aug 22, 2023
@expo-bot expo-bot removed the needs validation Issue needs to be validated label Aug 22, 2023
@adipascu
Copy link
Contributor

adipascu commented Nov 4, 2023

This seems to be caused by expo/eas-cli#2112

Copy link
Contributor

github-actions bot commented Feb 7, 2024

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Feb 7, 2024
@adipascu
Copy link
Contributor

adipascu commented Feb 7, 2024

Can we get a response from an expo maintainer before automatically closing this ticket?

Copy link
Contributor

github-actions bot commented May 7, 2024

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label May 7, 2024
@e-lucas-gestao
Copy link
Author

If anyone is still wondering, the problem was being caused by this line:
const isProduction = process.env.EXPO_PUBLIC_ENVIRONMENT === 'production'

app.config.ts acts up with console.log or any type of logic outside the config object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Versioned Expo CLI -- `npx expo start` stale
Projects
None yet
Development

No branches or pull requests

3 participants