Recently we build Android Apps using react expo and build signed APK using bellow command expo build:android -t apk
or Android App Bundle expo build:android -t app-bundle
After we build signed APK, we tried to upload to Playstore and some error appears that wanted us to upgrade target API from 26 to 28. Have explored and reading several QA at SO and many of them are intended for React Native. How we can publish our APK to Play Store?
Here are 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",
},
}
}
We've tried to check the documentation here
and there are property for compileSDKVersion or related like native apps.
In Native app we can easily configure as bellow
compileSdkVersion 27
buildToolsVersion "27.0.3"
minSdkVersion 16
targetSdkVersion 27
How to do that at React Expo?
Update 1 after reading from developer.android.com
When you upload an APK, it needs to meet Google Play’s target API level requirements. Starting August 1, 2019, Google Play requires that new apps target at least Android 9.0 (API level 28), and that app updates target Android 9.0 from November 1, 2019. Until these dates, new apps and app updates must target at least Android 8.0 (API level 26).
Still doesn't have any idea for that things.
2 Answers 2
Follow these steps:
- Close your Expo CLI server
In
app.json
, changesdkVersion
to"34.0.0"
In
package.json
, change these dependencies:react-native
to"https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz"
expo
to"^34.0.3"
react
to"16.8.3"
— (this exact version)react-navigation
to"^3.11.1"
jest-expo
to"^34.0.0"
(if you use it)sentry-expo
to"~1.13.0"
(if you use it)
If you use
react-navigation
you should also runexpo install react-native-gesture-handler react-native-reanimated
Delete your project’s
node_modules
directory and runnpm install
again or useyarn
Run
expo start -c
After these steps, it should work.
Source: https://blog.expo.io/expo-sdk-34-is-now-available-4f7825239319
Comments
You need to change the sdkVersion
property in your app.json
and build the application again:
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android"
],
using the expo build:android -t app-bundle
command.
Make sure you have the latest expo cli
installed.
Here's the corresponding blog post.