#Is is expected for an app to fail to reinstall/update when previous release was without Shorebird?

1 messages · Page 1 of 1 (latest)

thorn crown
#

I have internal Android app that I released to my users by manually downloading and installing it (outside of play store).

Then I have a mechanism that downloads a new version if available and installs it with user consent.

This however fails for my new build that I created using Shorebird. Here are my build commands, maybe I am missing something:

Previous/vanilla:
flutter build apk --target-platform android-arm64 --release --build-number $CI_PIPELINE_ID

Shorebird:
shorebird release -p android --artifact apk --target-platform android-arm64 --build-number $CI_PIPELINE_ID

#

I dont really need Shorebird for this app's use case, but I wanted to test it before committing to one of my production apps

hidden vault
#

"This however fails for my new build that I created using Shorebird. " I'm not sure what "This" is here.

#

the download and install mechanism?

#

Or the build itself?

thorn crown
#

the installation

#

installing Shorebird build over the vanilla build on the android device

hidden vault
#

e.g. the adb install command is failing?

thorn crown
#

let me try the adb install

#

adb: failed to install android_591.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 8 is older than current 586]

#

hmm, Shorebird seem to ignore the build number

hidden vault
#

@umbral quest was recently in this code and might remember. We definitely shouldn't ignore it, but possibly we're mishandling it somewhere.

thorn crown
#

i have the CI job log with --verbose if needed

umbral quest
#

I don't think we ever handle this specifically

thorn crown
#

the version "8" corresponds to what my AndroidManifest has as a default. Perhaps the build number parameter really isnt being used?

thorn crown
#

is there a solution without manually overwriting android and ios files?

umbral quest
#

I think you can just uninstall the old version and shorebird preview should work

thorn crown
#

thats not a solution, the build number needs to be respected

umbral quest
#

Oh sorry, I misunderstood the issue

#

This is a very stupid error on our part, but you need to pass build-number after --

#

So your release command becomes

shorebird release -p android --artifact apk --target-platform android-arm64 -- --build-number $CI_PIPELINE_ID

thorn crown
#

eh, will try, why not

umbral quest
#

It will work. The issue is that the --build-number option you were passing was not getting forwarded to Flutter