Problems upgrading detached app to SDK 33

Hi,

I’ve updated my detached project to SDK 33 following all the instructions from the blog post plus those specific to upgrading ExpoKit from SDK 32 to 33 on Android.

Now I can run my app perfectly in debug mode, but when I generate a signed APK I have a couple of problems:

  1. The first time I run the apk after installing, the app just fails to run completely and returns this error: “32.0.0 is not a valid SDK version. Options are 33.0.0, UNVERSIONED.”. What’s weird is that I can’t find any reference to version 32.0.0 anywhere in the code (and I’ve looked at both the Javascript and Java code). I’ve even changed the kernel-manifest.json file, even though I don’t know what it is, to replace it’s reference to 32.0.0 to 33.0.0.

  2. On every subsequent run, the app actually starts, but every asset is missing. I’ve analysed the APK and indeed there are no assets in the asset folder, even though they are referenced in the shell-app-manifest.json.

I’m not sure where to look in order to fix these problems, can anyone give me some pointers on what I can do to fix these problems?

Thanks in advance,
Francisco

2 Likes

That first error definitely seems weird. Have you been able to replicate that error on a fresh expo init ejected project? I’d just double check you followed all the upgrade instructions to be sure

Could you share the build ID? There may be some hints in the build logs about the issue regarding assets

Edit: also, if you could share your app.json file, that’d be good, too :+1:

The first problem happens because the app boots with the last downloaded bundle in storage. If you upgrade the app as opposed to reinstall it, there is a cached bundle still in storage, built with the old SDK.

Thanks for the replies guys, I got both problems solved after days.

The first problem, I’m not 100% sure of what the cause was, but I’m mostly convinced it had to do with Android’s auto backup (使用自動備份功能備份使用者資料  |  Android Developers), which had stored an old version of my app’s data (cached bundle included) in Google Drive, and was loading that old version everytime I installed the app. That would explain why the error only happened on the first run, as the second run would use a newly downloaded bundle.

The second problem was due to a coincidence of three things:

  • the expo.gradle file (where the bundling of assets happens) only runs said bundling for targets that contain either “prod” or “release”
  • expo sdk 33 renamed targets by removing the “devKernel” and “prodKernel” from the names
  • I have custom buildTypes on my build.gradle named “dev” and “staging” (corresponding to release-channels with the same name).

So, what happened is that, on sdk 32, my targets would be named “prodKerneldev” and “prodKernelstaging”, thus including “prod” in the name. On sdk 32 my targets are named just “dev” and “staging”, and expo.gradle skipped bundling.

All in all, two very annoying problems that took me two full days to fix… :weary:

1 Like

Currently i have the same issue, assets images and icons not showing up in release apk.
What were the changes you made it to work of your problem 2, i have doubt which part of file to change.
I log new issue here.
Could you please help me to fix it?

Hi @raikumark, do custom buildTypes like I had (mines were named dev and staging)? Because my problem only ocurred because of that, otherwise it would have worked.
If you do, all you need to do is go to file expo.gradle and change this line:

enabled targetName.toLowerCase().contains("release") || targetName.toLowerCase().contains("prod")

to this:

enabled targetName.toLowerCase().contains("release") || targetName.toLowerCase().contains("prod") || targetName.toLowerCase().contains("dev") || targetName.toLowerCase().contains("staging")

If you don’t have custom buildTypes your problem is different than mine and I’m not sure how to help…

Hi @fvieira

I have a problem while updating expo from 32 to 33 ( its a detached project ),

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id ‘com.google.gms.google-services’]

Can you help me to fix …