shorebirdtech / samples

A collection of Shorebird samples and demos
MIT License
16 stars 0 forks source link

fix: AAR should not use app release version #11

Open LammPhan opened 2 months ago

LammPhan commented 2 months ago

Description

I'm setting code push for flutter module on platform android app native. My current flutter version is 3.13.9. my config app native is

defaultConfig {
       ...
        versionCode 1
        versionName "1.0.0"
       ...
    }

I created library aar by command shorebird release aar --release-version 1.0.0+1 --flutter-version=3.13.9 my release app works normally, but when I release a new patch by command shorebird patch aar --release-version=1.0.0+1 My app can not update that patch Someone can help me please!

here is my logcat error Screenshot 2024-04-25 at 5 39 47 PM

here is my flutter doctor Screenshot 2024-04-25 at 5 42 37 PM

eseidel commented 2 months ago

The updater is saying that the binary produced by shorebird release is not the same binary as you are running to receive the patch.

Are you using shorebird preview or are you running the app in some other way?

LammPhan commented 2 months ago

The updater is saying that the binary produced by shorebird release is not the same binary as you are running to receive the patch.

Are you using shorebird preview or are you running the app in some other way?

No, I'm using app Add to app in flutter follow document shorebird. So I can't apply shorebird preview command

eseidel commented 2 months ago

Ah yes, it's definitely much easier to hit this error in the add2app flow.

eseidel commented 1 month ago

The solution here (which I think we have another bug on?) is to create some mechanism for us to version the contents of an aar, separately from the release version from the aab.

Shorebird depends on the stores enforcing one-version-per-aab rules, meaning that the version number is unique for a given set of aab contents. If we move away from that we'll need our own uniqueness mechanism, or find some other one that Android has (maybe it already has some sort of aab/apk identifier that isn't the release version number?)

eseidel commented 1 month ago

https://github.com/shorebirdtech/shorebird/issues/793 has more discussion of a similar issue.