#Issue on Android flutter hybird

1 messages · Page 1 of 1 (latest)

surreal zenith
#

hi, I am working on a hybrid android app and trying to implement shorebird, but it keeps showing the hash mismatch error during the release build.

I have been asked this question a few months ago, but I thought the problem might be the KMM we had embedded on the native side. We had already remove the KMM on native, but the hash mismatch problem is still there. Is there are any possible factor on the native side to occurs this error ?

ancient saffron
#

That error means that the patch you're trying to apply was created for a different release build

#

Which is unfortunately very easy to do for aars

#

Can you share the steps you took (commands you ran, etc) that got you to the hash mismatch error?

surreal zenith
#
  1. shorebird release aar --release-version=4.0.0+7

  2. native: run a release build on android emulator (the log from shorebird are matched with the correct release version)

  3. make some changes on flutter

  4. shorebird patch aar --release-version=4.0.0+7

  5. kill app on emulator and launch again

  6. and here goes the hash mismatch error

#

I tried on the the demo add-to-app android native project with my flutter module, and the updated run perfectly. I assume is the native project we had to causing the hash mismatch error

ancient saffron
#

The hash mismatch error is only related to the flutter changes. When we create a patch, what we're doing is creating a binary diff of the new (patch) build against the old (release) build. Installing a patch on device "inflates" the diff by applying it to the on-disk release build. A hash mismatch means that the "inflated" on-device patch is not the same as the one that was uploaded, which usually means we're applying the diff to a different base (that is, a different release build)

#

But all of these "builds" are specifically the flutter bits of the app. The native code doesn't factor in at any point