Android: new build does not update content of the app

Hi everyone! I’m having some troubles when building my app for Android: let me give you a bit of context, hope you can help and thanks in advance!

A few weeks ago, I built my first build with expo and submitted it to the play store. Everything went fine and I was able to start a closed test of my new app. Since then, I did some improvements and changes to my app and created another build (I’m using the bare workflow). In order to do that, I launched expo prebuild + eas build --platform android. Unfortunately, it turns out that the resulting build is exactly the same as the very-first build (the old one of a few weeks ago).

I tried to increment my version code and version name, but nothing changed. I also tried to set “cache” to false in my eas.json, without success. Note that, when building the app with Android Studio (dev-client) the app works as expected.

I’m sure that the issue stays BEFORE the play store stage because I built an internal build for internal use, downloaded the APK, and the app was still the old one.

Am i doing something wrong? Everything seems to work fine for iOS thank you!

eas-cli/2.1.0 darwin-x64 node-v16.16.0

Should anyone else have this issue, I solved by running these commands:

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle

cd android

./gradlew assembleRelease

Could someone clarify why expo prebuild was not enough?

can you share a link to your build page? you definitely shouldn’t need to run that command.

Hi @brents , thank you for your reply!

I changed my project setting to unlisted and tried to visit a link in incognito mode, but it is inaccessible. What king of information are you looking for? Maybe I can paste it here for you!

Thank you!

i work at expo and can access build pages in order to help with debugging

(oops i just realized that i replied from a different account. i am @brents and @notbrent - not confusing at all, right?)

Thank you @notbrent (and also thank you, @brents ! :slight_smile: )

This is an example of build which was not reflecting my changes: Build Details — 945b89fb-5f2f-4026-b5c7-5a8d706aeae3 — orari-traghetti-golfo-di-napoli — Expo

Thank you!

I’ve been having this same issue, except with iOS… Our Android app is updating properly so far. I think this is something to do with expo publish since this started happening after we inadvertently used expo publish a couple weeks ago which broke our app for all production users. We didn’t even know it was enabled by default! Now I think we have these updates published that for some reason the iOS app is using every time it goes to Testflight.

it looks like the app is bundling js as expected

however they are being written to a different location than what you have shared above.

in the build: android/app/build/generated/assets/react/release/index.android.bundle
the path you shared above: android/app/src/main/assets/index.android.bundle

have you possibly introduced flavors into your project? this could be a related issue: after upgrade 0.67.3 -> 0.69.5 build release apk was success but miss index.android.bundle when start app with Flavors · Issue #34606 · facebook/react-native · GitHub

1 Like

I’d say I’m not using Flavors or, at least, I didn’t enable this behavior intentionally. How can I verify it to give a more precise answer?

To give you a bit more context (IDK if this helps) this is my very first react native+expo project. I can’t recall the exact command used to create the android and ios folders (from the git history I see that the very first commit included those folders). Everything worked fine until I needed to customize my splash screen, which was not working on android. After launching expo prebuild some files have been added/deleted/moved from the android package and the splash screen started working again.

Is it possible that there is some misconfiguration somewhere into my project? What should I check/share with you in order to troubleshoot efficiently?

Thank you for your support!

Hi @mrgingles

You might have chosen “bare” when initially creating the project with expo init.

If you are not actually making changes to the native code yourself, you can remove the android and ios directories to switch back to the managed workflow. See expo.fyi/prebuild-cleanup for more details.

It might be the case, indeed! At the moment I need to use the bare workflow since I implemented some third parties components (such as Firebase) which require a bare workflow.

This is not accurate. Although it might be easier in some cases to use the bare workflow to integrate a dependency, in princliple it can also be done in the managed workflow using config plugins.

That’s great to know, thank you! As I mentioned before, I’m totally new to expo and I definitely still have to learn about it!

Do you have any clue about my original issue? Let’s pretend for a second that a bare workflow is the only way I have to handle my project, what should I check to be sure that all the settings (for example the above mentioned build path) are ok?

Thank you!

Well, there’s a lot I don’t know about it myself :slight_smile: Also, config plugins and EAS Build are still relatively new and there’s a lot of documentation out there that is outdated as a result.

Sorry, I don’t know. I have no experience building a mobile app with Xcode or Android Studio rather than expo build or eas build.

I think what I would do, though, is this:
Assuming your custom changes to the native code are minimal; only what is necessary to integrate Firebase and similar dependencies, I would run npx expo prebuild --clean to regenerate the ios and android projects from scratch. Then re-do your changes to integrate Firebase (etc.).

Then, if you have some time, see if you can migrate to config plugins instead.

Basically a config plugin is just some code to automatically make the changes that you would otherwise have to make manually to integrate a dependency. So if the instructions tell you to edit AndroidManifest.xml then your config plugin would use withAdroidManifest to make those changes. Then when npx expo prebuild is run, the config plugin will be called to make those changes.

The build servers automatically run npx expo prebuild as part of the build process for managed apps.

1 Like