Expo latest SDK throwing error on lower versions of Android after expo eject.

Please provide the following:

  1. SDK Version: 47.0.0
  2. Platforms(Android/iOS/web/all): Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I have just switched to the latest version of expo SDK.
But after expo eject, when I try to build Apk / App bundle, app getting crashed on lower versions of Android phones.
This is the error I am getting & not finding any solution other than using a higher version of android phone.
Please find the screen shot of the error attached herewith.

Please Help !!

Could you elaborate a little? Why are you ejecting exactly? (Also, these days if you want to get the native projects for some reason then you would use “npx expo prebuild” instead of “expo eject”)

It sounds like you had an existing app. You upgraded the app to Expo SDK 47. And then you ran expo eject. That seems a bit strange to me. So if you could elaborate on what you’re doing and why you need the native projects it might help to clarify what you need to do :slight_smile:

Also, could you say what versions of Android you’ve seen the crash on?

Thanks for the information, it seems working with npx expo prebuild, with expo eject it was not working.
Reason of ejecting it is : I have found that if I create apk/bundle using expo build, its size is increasing & also at the same time, its adding some package that is causing rejection on google play store because of Data Safety Section. It says :
Policy Declaration - Data Safety Section: Device Or Other IDs Data Type - Device Or Other IDs (some common examples may include Advertising ID, Android ID, IMEI, BSSID, MAC address), Possible SDKs: com.stripe:stripe-3ds2-android
However my app is not using this package, its nowhere inside package file & I am not taking any information that causes this rejection…

Good

That is one of the main reasons that eas build was created. If you build with eas build then it will only include the code from your dependencies. So it will not be large.

By the way, for production you should build .aab files instead of .apk files. This is the default. If you upload a .aab file to Google Play then Google Play will generate a version of the APK specifically for the user’s phone when it is downloaded. So the .aab file will still look big because it contains code for 32 bit, 64 bit, x86, ARM, etc., but when the user downloads it from Google Play it will be smaller because it will contain only what the user’s phone needs.

This is another reason EAS Build was created and the solution is the same. Since EAS Build only includes what you have specified in your package.json, it will not contain these extra packages if you are not using them.

Thank you for your reply & information.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.