Expo初使用踩坑

759 阅读1分钟

Expo初使用踩坑

  1. 使用eas build打包安卓,云端查看日志报错--->run gradlew--->提示compileSdkVersion版本问题:

    image-20221202182603306

    解决办法:

    1. 项目中安装expo-build-properties插件:

      expo install expo-build-properties
      
    2. 在app.json中添加:

    {
        "expo":{
            ...
    ​
            "plugins": [
              [
                "expo-build-properties",
                {
                  "android": {
                    "compileSdkVersion": 33
                  }
                }
              ]
            ]
        }
    }  
    

    重新执行:

    eas build --platform android