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.
It helps you from the creation to distribution of your React Native apps. Remember, when you are coding in Expo, you still write React Native code. But with the support of the Expo CLI and Expo Client on your smartphone. It is better to use Expo CLI if you are new to app development.
In app.json
, change sdkVersion
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 run expo install react-native-gesture-handler react-native-reanimated
Delete your project’s node_modules
directory and run npm install
again or use yarn
Run expo start -c
After these steps, it should work.
Source: https://blog.expo.io/expo-sdk-34-is-now-available-4f7825239319
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With