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

EAS Init iosUrlScheme with environment variable fails #2593

Closed
deelo55 opened this issue Sep 23, 2024 · 2 comments
Closed

EAS Init iosUrlScheme with environment variable fails #2593

deelo55 opened this issue Sep 23, 2024 · 2 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@deelo55
Copy link

deelo55 commented Sep 23, 2024

Build/Submit details page URL

No response

Summary

My app.config.js has the following:

      "@react-native-google-signin/google-signin",
       {
         iosUrlScheme: process.env.REVERSED_GOOGLE_CLIENT_ID,
       },

EAS Init fails:
google-sign-in without Firebase config plugin: Missing iosUrlScheme in provided options: {}
Error: project:init command failed.

If I change process.env.REVERSED_GOOGLE_CLIENT_ID to a string, it works fine

Managed or bare?

Managed

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 15.0
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.17.0/bin/yarn
npm: 10.8.3 - ~/.nvm/versions/node/v20.17.0/bin/npm
Managers:
CocoaPods: 1.15.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 24.0, iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, watchOS 11.0
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2411.12071903
Xcode: 16.0/16A242d - /usr/bin/xcodebuild
npmPackages:
expo: ~51.0.20 => 51.0.32
expo-router: ~3.5.18 => 3.5.23
react: 18.2.0 => 18.2.0
react-native: 0.74.3 => 0.74.3
react-native-web: ^0.19.12 => 0.19.12
npmGlobalPackages:
eas-cli: 12.4.1
Expo Workflow: bare

Error output

No response

Reproducible demo or steps to reproduce from a blank project

N/A

@deelo55 deelo55 added the needs review Issue is ready to be reviewed by a maintainer label Sep 23, 2024
@deelo55
Copy link
Author

deelo55 commented Sep 26, 2024

Need to add the .env variables to eas.json:
e.g.

 "preview": {
      "distribution": "internal",
      "env": {
        "REVERSED_GOOGLE_CLIENT_ID": "com.googleusercontent.apps.1025734155640-0ieol2kjdv26ub7vvbhcqho99kvfcvdg",}

@deelo55 deelo55 closed this as completed Sep 26, 2024
@robinsadeghpour
Copy link

I have the same issue, the env is set correctly and read correctly. But I still get:

google-sign-in without Firebase config plugin: Missing `iosUrlScheme` in provided options: {}
    Error: build command failed.

this is my app.config.js:

const config = require("./config.js");

console.log(process.env.EXPO_PUBLIC_IOS_URL_SCHEME)

module.exports = {
  expo: {
    name: config.general.appName,
    slug: config.general.slug,
    version: "1.0.0",
    orientation: "portrait",
    icon: config.general.icon,
    scheme: config.general.scheme,
    userInterfaceStyle: "automatic",
    splash: {
      image: config.general.splashImage.light,
      resizeMode: "contain",
      backgroundColor: "#ffffff",
      dark: {
        image: config.general.splashImage.dark,
        resizeMode: "contain",
        backgroundColor: "#000000"
      }
    },
    ios: {
      supportsTablet: false,
      usesAppleSignIn: true,
      bundleIdentifier: config.general.iosBundleIdentifier,
      infoPlist: {
        CFBundleURLTypes: [
          {
            CFBundleURLSchemes: [
              process.env.EXPO_PUBLIC_IOS_URL_SCHEME,
            ]
          }
        ]
      }
    },
    android: {
      adaptiveIcon: {
        foregroundImage: config.general.icon,
        backgroundColor: "#ffffff"
      },
      package: config.general.androidPackageName,
      permissions: []
    },
    plugins: [
      "expo-router",
      "expo-localization",
      [
        "@react-native-google-signin/google-signin",
        {
          iosUrlScheme: process.env.EXPO_PUBLIC_IOS_URL_SCHEME,
        }
      ],
      [
        "expo-image-picker",
        {
          photosPermission: "The app accesses your photos to let you share them with your friends."
        }
      ],
      "expo-apple-authentication",
      [
        "onesignal-expo-plugin",
        {
          mode: "development"
        }
      ],
      [
        "@sentry/react-native/expo",
        {
          url: process.env.EXPO_PUBLIC_SENTRY_URL,
          project: process.env.EXPO_PUBLIC_SENTRY_PROJECT,
          organization: process.env.EXPO_PUBLIC_SENTRY_ORGANIZATION,
        }
      ],
      [
        "expo-build-properties",
        {
          android: {
            minSdkVersion: 24
          }
        }
      ],
    ],
    experiments: {
      typedRoutes: true
    },
    extra: {
      router: {
        origin: false
      },
      eas: {
        projectId: config.general.easProjectId
      },
    }
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants