expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
778 stars 81 forks source link

TypeError: Cannot read property 'withRootViewBackgroundColor' of undefined #790

Closed yonitou closed 2 years ago

yonitou commented 2 years ago

Summary

When building using eas on iOS the following message appears before the start of iOS build =>

TypeError: Cannot read property 'withRootViewBackgroundColor' of undefined

Expected behavior : iOS build should start Actual behavior : iOS build canceled

Environment

EAS CLI 0.38.0 environment info: System: OS: macOS 12.0.1 Shell: 5.8 - /bin/zsh Binaries: Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v12.18.1/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v12.18.1/bin/npm Utilities: Git: 2.34.0 - /opt/homebrew/bin/git npmPackages: expo: ^43.0.0 => 43.0.3 expo-cli: ^4.13.0 => 4.13.0 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3

Error output

TypeError: Cannot read property 'withRootViewBackgroundColor' of undefined

Reproducible demo or steps to reproduce from a blank project

Run eas build -p ios

dsokal commented 2 years ago

Hi @yonitou, I can't reproduce the issue. Could you try reinstalling eas-cli?

yonitou commented 2 years ago

Just did and same error :/ I downgraded back to 0.37 and it now works perfectly.

Maybe, to reproduce, you can try having the same app.config.ts structure that we have ?

import { ExpoConfig, ConfigContext } from "@expo/config";
import "dotenv/config";

const BUILD_NUMBER = "400";
const BUILD_VERSION = "4.0.0";

const BUNDLE_ID = "com.XXX.YYY";

export default ({ config }: ConfigContext): ExpoConfig => ({
    ...config,
    extra: {
        build: BUILD_NUMBER,
        version: BUILD_VERSION,
        baseURL: process.env.BASE_URL,
    },
    name: "XXX",
    slug: "XXX",
    owner: "XXX",
    privacy: "public",
    platforms: ["ios", "android", "web"],
    version: BUILD_VERSION,
    orientation: "portrait",
    icon: "./assets/icon.png",
    plugins: ["./lib/withSimulatorExcludedArchitecture.ts", "sentry-expo"],
    splash: {
        image: "./assets/splash.png",
        resizeMode: "cover",
        backgroundColor: "#2C6465",
    },
    updates: {
        fallbackToCacheTimeout: 0,
    },
    assetBundlePatterns: ["**/*"],
    hooks: {
        postPublish: [
            {
                file: "sentry-expo/upload-sourcemaps",
                config: {
                    organization: "XXX",
                    project: "XXX",
                    authToken: "XXX",
                },
            },
        ],
    },
    ios: {
        buildNumber: BUILD_NUMBER,
        supportsTablet: true,
        bundleIdentifier: BUNDLE_ID,
        infoPlist: {
            NSCameraUsageDescription:
                "XXXX",
            NSLocationAlwaysUsageDescription:
                "XXXX",
            NSLocationWhenInUseUsageDescription:
                "XXXX",
            NSLocationAlwaysAndWhenInUseUsageDescription:
                "XXXX",
            UIBackgroundModes: ["location", "fetch"],
        },
        config: {
            googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY,
        },
    },
    androidStatusBar: {
        hidden: false,
        translucent: true,
        barStyle: "dark-content",
        backgroundColor: "#FFFFFF",
    },
    notification: {
        icon: "./assets/icon.png",
        color: "#67dee1",
    },
    android: {
        package: BUNDLE_ID,
        versionCode: parseInt(BUILD_NUMBER, 10),
        googleServicesFile: "./google-services.json",
        config: {
            googleMaps: {
                apiKey: process.env.GOOGLE_MAPS_API_KEY,
            },
        },
        useNextNotificationsApi: true,
        permissions: [
            "CAMERA",
            "NOTIFICATIONS",
            "READ_EXTERNAL_STORAGE",
            "USE_FINGERPRINT",
            "VIBRATE",
            "WAKE_LOCK",
            "WRITE_EXTERNAL_STORAGE",
            "ACCESS_FINE_LOCATION",
            "ACCESS_COARSE_LOCATION",
            "com.anddoes.launcher.permission.UPDATE_COUNT",
            "com.android.launcher.permission.INSTALL_SHORTCUT",
            "com.google.android.c2dm.permission.RECEIVE",
            "com.google.android.gms.permission.ACTIVITY_RECOGNITION",
            "com.google.android.providers.gsf.permission.READ_GSERVICES",
            "com.htc.launcher.permission.READ_SETTINGS",
            "com.htc.launcher.permission.UPDATE_SHORTCUT",
            "com.majeur.launcher.permission.UPDATE_BADGE",
            "com.sec.android.provider.badge.permission.READ",
            "com.sec.android.provider.badge.permission.WRITE",
            "com.sonyericsson.home.permission.BROADCAST_BADGE",
        ],
    },
});
dsokal commented 2 years ago

Your app config looks good at first glance. We just released a new version of eas-cli (0.38.1) that includes @expo/* deps upgrade. Can you check if it works for you?

sean-m-oleary commented 2 years ago

Same issue here using plugins. I have eas-cli 0.38.1 too... @dsokal

brentvatne commented 2 years ago

@sean-m-oleary - this is likely an issue with using yarn to install eas-cli globally. run yarn global remove eas-cli && npm i -g eas-cli. or if you want to keep using yarn, then yarn global remove eas-cli && yarn global add eas-cli - but we recommend using npm for global installs because we have seen issues arise like this with yarn

dsokal commented 2 years ago

Closing because of the inactivity.