Yoh*_* AI 6 android react-native expo
最近我们使用 react expo 构建 Android 应用程序并使用 bellow 命令expo build:android -t apk或 Android App Bundle构建签名的 APKexpo build:android -t app-bundle
在我们构建了签名的 APK 之后,我们尝试上传到 Playstore,但出现了一些错误,希望我们将目标 API 从 26 升级到 28。在 SO 上探索并阅读了几个 QA,其中许多是针对 React Native 的。我们如何将我们的 APK 发布到 Play 商店?
这里有 app.json
{
"expo": {
"name": "***",
"slug": "***",
"privacy": "public",
"sdkVersion": "32.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.2.3",
"orientation": "portrait",
"icon": "./assets/logo.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"enabled": true,
"checkAutomatically": "ON_LOAD",
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.qreatiq.foodmart",
"permissions": [
"CAMERA"
],
"googleServicesFile": "./google-services.json",
},
}
}
Run Code Online (Sandbox Code Playgroud)
我们试图检查文档,here并且有 compileSDKVersion 或相关的本机应用程序的属性。
在本机应用程序中,我们可以轻松配置如下
compileSdkVersion 27
buildToolsVersion "27.0.3"
minSdkVersion 16
targetSdkVersion 27
Run Code Online (Sandbox Code Playgroud)
如何在 React Expo 做到这一点?
从developer.android.com阅读后更新 1
当您上传 APK 时,它需要满足 Google Play 的目标 API 级别要求。自 2019 年 8 月 1 日起,Google Play 要求新应用至少面向 Android 9.0(API 级别 28),并且从 2019 年 11 月 1 日起应用更新面向 Android 9.0。在这些日期之前,新应用和应用更新必须至少面向 Android 8.0(API 级别 26)。
对那些事情还是没有任何想法。
小智 2
在 中app.json,更改sdkVersion为"34.0.0"
在 中package.json,更改这些依赖项:
react-native到"https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz"expo到"^34.0.3"react到"16.8.3"\xe2\x80\x94 (这个确切的版本)react-navigation到"^3.11.1"jest-expo到"^34.0.0"(如果你使用它)sentry-expo到"~1.13.0"(如果你使用它)如果你使用react-navigation你还应该运行expo install react-native-gesture-handler react-native-reanimated
删除你的项目\xe2\x80\x99snode_modules目录并npm install再次运行或使用yarn
跑步expo start -c
完成这些步骤后,它应该可以工作。
\n\n来源:https ://blog.expo.io/expo-sdk-34-is-now-available-4f7825239319
\n| 归档时间: |
|
| 查看次数: |
4806 次 |
| 最近记录: |