【问题标题】:Why does a green status bar appears when i build with eas?为什么我用eas构建时会出现绿色状态栏?
【发布时间】:2022-10-17 04:57:17
【问题描述】:

为什么当我编译我的应用程序时,状态栏突然出现。当我在 expo go 应用程序或 android 模拟器中测试它时,你看不到状态栏,但是一旦我用 eas 构建它到 apk,它就会出现并将我的整个应用程序设计向下移动?

.

这是我的 eas.json

{
  "cli": {
    "version": ">= 2.1.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "channel": "preview",
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "channel": "production"
    }
  },
  "submit": {
    "production": {}
  }
}

.

这是我的 app.config.js

export default
{
  expo: {
    name: "Campus Market",
    description: "",
    slug: "cmkt",
    scheme: "campusmarket",
    owner: "***",
    version: "1.0.0",
    orientation: "portrait",
    icon: "./assets/icon.png",
    userInterfaceStyle: "light",
    backgroundColor: "#f2f2f2",
    primaryColor: "#72e292",
    splash: {
      image: "./assets/splash.png",
      resizeMode: "contain",
      backgroundColor: "#72e292"
    },
    updates: {
      fallbackToCacheTimeout: 0,
      url: "https://u.expo.dev/***",
    },
    runTimeVersion: {
      policy: "sdkVersion",
    },
    jsEngine: "hermes",
    assetBundlePatterns: [
      "**/*"
    ],
    ios: {
      supportsTablet: false,
      bundleIdentifier: "***",
    },
    android: {
      package: "***",
      adaptiveIcon: {
        foregroundImage: "./assets/adaptive-icon.png",
        backgroundColor: "#72e292"
      },
      permissions: [],
    },
    extra: {
      eas: {
        projectId: "***",
      }
    },
  }
}

我该如何摆脱它? :(

我正在使用 expo sdk 46、expo-cli 6.0.5 和 eas 2.0.1

【问题讨论】:

    标签: javascript android react-native expo eas


    【解决方案1】:

    问题与反应导航有关,与博览会或 eas 无关。

    我使用屏幕中 expo-status-bar 中的状态栏组件修复了它:

    <StatusBar translucent backgroundColor="transparent" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-13
      • 2021-06-09
      • 1970-01-01
      • 1970-01-01
      • 2019-10-29
      • 1970-01-01
      • 2018-11-10
      • 1970-01-01
      相关资源
      最近更新 更多