shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2k stars 121 forks source link

"shorebird patch aar --release-version" does not update changes in app #1319

Closed gaurav-zdroid closed 8 months ago

gaurav-zdroid commented 8 months ago

I pushed a patch for andriod with some changes in code. But changes are not reflecting in the application.

Release build and patch release were successful.

Note : Release build was created through CI in Bitrise and patch pushed through IDE.

Screenshot 2023-09-24 at 10 06 20 PM Screenshot 2023-09-24 at 10 07 29 PM
eseidel commented 8 months ago

Are you able to share logs from the app running on a device? e.g. adb log -s flutter?

I'm surprised that the release version is just 10.16 and not 10.16+1, I wonder if the lack of buildNumber could be confusing our update checks? adb logcat will tell us either way.

eseidel commented 8 months ago

Oh, sorry this is an AAR build, not an AAB build, so the release number is not built into the aar, but rather passed to it during execution if I recall correctly?

https://docs.shorebird.dev/guides/add-to-app/android

@bryanoltman may have further thoughts.

bryanoltman commented 8 months ago

Yeah, it's odd that the release version has no build number. The only release I'm seeing for your app in our DB has a version 10.16+9034350, which won't pick up patches created for release version 10.16. Has the release command output been altered?

gaurav-zdroid commented 8 months ago

@bryanoltman yes, I deleted previous version i.e. 10.16 and deployed new build 10.16+9034350 and push patch on that build but now i open my app multiple times but there is no changes detected.

bryanoltman commented 8 months ago

What do you see in logcat? Is shorebird checking for a patch and not finding it? Also, what do you see for the release in the Shorebird console? Does the logcat output match the version number you see there?

gaurav-zdroid commented 8 months ago

No shorebird is not checking for patch.

bryanoltman commented 8 months ago

That means that your app is not using the shorebird-produced aar.

Have you gotten this working locally? Can you build in Android Studio with the result of flutter release aar --release-version x.y.z?

gaurav-zdroid commented 8 months ago

No, For creating a complete build I am using the Bitrise tool because my app is mix code[React + Flutter] and for patch I pushed locally.

bryanoltman commented 8 months ago

Hrm, I worry it will be tough to debug if it's only building on bitrise. Have you followed the guide at https://docs.shorebird.dev/guides/add-to-app/android? Can you share the edits you made to your settings.gradle and app/build.gradle?

bryanoltman commented 8 months ago

I'm also not sure how you would be able to generate a patch locally without also being able to build in Android Studio. Have you tried?

gaurav-zdroid commented 8 months ago

yes I followed the steps.

this piece of code I added in android/build.gradle

Screenshot 2023-09-26 at 12 59 10 AM

and this one in app/build.gradle

Screenshot 2023-09-26 at 1 00 24 AM Screenshot 2023-09-26 at 1 04 07 AM
bryanoltman commented 8 months ago

That looks fine. What command are you running in your CI? Are you sure you're packaging up the app with the aar that is generated by shorebird? Based on the absence of shorebird in your logs, I would guess not

gaurav-zdroid commented 8 months ago

For creating aar i am running this command. Release version is hard coded for now.

Screenshot 2023-09-26 at 1 26 16 AM

but let me check that which aar is used for final build and I will also try to make a release build locally.

gaurav-zdroid commented 8 months ago

Its fixed, issue was not using aar generated by shorebird. thanx @bryanoltman