【问题标题】:React native Expo Build Number does not IncreaseReact native Expo Build Number 不增加
【发布时间】:2022-12-16 00:09:46
【问题描述】:

我正在尝试构建版本“1.2.0”,我已经更改了 app.json 中的每个“buildNumber”和“version”,expo 仍然构建 ios buildNumber:“1.0.0”。我在用 eas build --profile production --platform ios

{
  "expo": {
    "name": "Redacted",
    "slug": "Redacted",
    "description":"Redacted",
    "version": "1.2.0",
    "orientation": "portrait",
    "icon": "./assets/mark.png",
    "splash": {
      "image": "./assets/TRANSPARENT2.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "buildNumber": "1.2",
      "infoPlist": {
        "NSFaceIDUsageDescription": "This app uses the FaceID feature to login. If faceID fails or if it is not available for any reason, the app will fall back to a standard login system."
      }
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      },
      "permissions": [
        "CAMERA",
        "USE_FINGERPRINT",
        "USE_BIOMETRIC",
        "VIBRATE"
      ],
      "package": "Redacted"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      [
        "expo-notifications",
        {
          "icon": "./assets/DarkVersion.png",
          "color": "#d2282e",
          "sounds": [
            "./assets/notification.m4r"
          ]
        }
      ]
    ]
  }
}

这就是我在 expo.dev 上得到的...因此我无法提交该应用程序。

这是控制台中的错误。

【问题讨论】:

    标签: react-native expo


    【解决方案1】:

    同样的经历

    我在更新 my-expo-project 中的 app.json 文件时有类似的经历。 我将版本字符串保持为相同的0.9.9,仅将内部版本号字符串从124更改为125

    运行 eas build --profile production --platform iOS 导致相同的控制台错误。

    您已经提交了此版本的应用。

    expo.dev 上的构建摘要显示旧的构建号已交付。

    解决方案

    结果我不得不使用 expo prebuild 命令来解决这个问题。

    ➜  my-expo-project git:(v125) $ expo prebuild
    ✔ Created native projects | /android, /ios already created | gitignore already synced
    ✔ Updated package.json and added index.js entry point for iOS and Android
    ? Using npm to install packages.
    ✔ Cleaned JavaScript dependencies 3698ms
    ✔ Installed JavaScript dependencies 11150ms
    ✔ Config synced
    

    现在应用程序配置已同步到 ./iOS./Android 文件夹 eas build --profile production --platform iOS 现在将正确的包和构建号传送到 expo.dev

    【讨论】:

      【解决方案2】:

      事实证明 eas build --profile production --platform ios 不会在每次运行时更新 plist 文件(超级蹩脚的 IMO)。您需要手动进入./ios/<yourApp>/plist 文件并更新CFBundleVersionCFBundleShortVersionString 键。这只是你第一次运行 eas build --profile production --platform ios 之后的事情

      【讨论】:

        【解决方案3】:

        如果您没有任何本机代码或没有更新 ios 或 android 文件夹中的本机代码,您可以删除这些文件夹并让 EAS 为您处理构建。如果没有这些文件夹,eas build -p ios 有或没有 --local 将从 app.json 文件更新内部版本号。

        如果你想保留 ios 和 android 文件夹,你必须按照@L4ivi 的建议运行npx expo prebuild,或者你可以更新进入 ios > info.plist 文件的版本,并为你的版本更新CFBundleShortVersionString 的字符串值编号和 CFBundleVersion 作为您的内部版本号。或者您可以打开 .xcworkspace 文件以在 Xcode 中打开项目并在那里更新版本和内部版本号。

        【讨论】:

          猜你喜欢
          • 2022-06-14
          • 1970-01-01
          • 1970-01-01
          • 2018-09-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-05-06
          • 1970-01-01
          相关资源
          最近更新 更多