React Native iOS Build in expo失败

rsl1atfo  于 11个月前  发布在  iOS
关注(0)|答案(2)|浏览(151)

我在运行以下命令以生成iOS构建时出现以下错误:
eas build -p ios --配置文件开发
错误代码:iOS构建失败:某些Pod需要更高的最低部署目标。您可以使用https://docs.expo.dev/versions/latest/sdk/build-properties/配置插件来覆盖默认的原生构建属性,并设置不同的最低部署目标。
我已经在我的app.json文件中添加了所需的设置,下面是我的app.json文件代码:

{
  "expo": {
    "name": "music-game",
    "slug": "music-game",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "deploymentTarget": "13.0"
          }
        }
      ],
      "@react-native-google-signin/google-signin"
    ],
    "ios": {
      "bundleIdentifier": "eugene.googleauthexporeactnative",
      "supportsTablet": true,
      "deploymentTarget": {
        "iOS": "13.0"
      },
      "infoPlist": {
        "CFBundleURLTypes": [
          {
            "CFBundleURLSchemes": [
              "com.googleusercontent.apps.892931882481-hk2pau3bf2072p93m3ojoi4tcbs68795"
            ]
          }
        ]
      }
    },
    "android": {
      "package": "eugene.googleauthexporeactnative",
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "2b4138b9-b257-4e53-95d6-b6965cfc2d73"
      }
    },
    "owner": "eugene1981"
  }
}

字符串
谁能告诉我,我错在哪里?
我已经在https://docs.expo.dev/versions/latest/sdk/build-properties/上查看了文档
并与app.json的示例进行了比较,并回顾了部署目标设置为,。

vc6uscn9

vc6uscn91#

我解决了这个问题!文档中写道:“每个版本的Expo SDK都支持Android和iOS的最低操作系统版本。”
我把它调高到14,“安装-构建-属性”,{“ios”:{“deploymentTarget”:“14.0”} }
它现在起作用了!

v6ylcynt

v6ylcynt2#

为了给予有关尤金的答案的更多信息,以下是参考文档:https://docs.expo.dev/versions/latest/sdk/build-properties/
总而言之,如果你还没有下载npm软件包npm-build-properties(expo官方支持),请在https://www.npmjs.com/package/expo-build-properties下载。
然后,在app.json文件中,将以下内容添加到plugins部分(或者添加plugins属性,如果您还没有的话):

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 31,
            "targetSdkVersion": 31,
            "buildToolsVersion": "31.0.0"
          },
          "ios": {
            "deploymentTarget": "13.0"
          }
        }
      ]
    ]
  }
}

字符串

相关问题