-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Shorebird Detects Native Changes Incorrectly When Patching #2930
Comments
Hi @varoxez8 👋 Are you able to share a link to a minimal reproduction sample on GitHub? It would also be helpful to see a list of your native dependencies (or just your |
Hello @felangel
also this is my build script for android release and patch release
patch
|
My understanding is that the only check we perform for "native changes" on iOS is checking that the Podfile.lock hash matches. This is because XCode makes other unstable modifications to the binary on each build. (On Android we do something much fancier involving diffing the binaries since Android's clang toolchain produces repeatable/stable builds.)
|
Oh, sorry. This is about android. I see in the original message this involves:
|
That typically means that java/kotlin code is changing. Which can be caused by changes to Dart packages if they have a "native" component. Typically checking in pubspec.lock prevents such changes (which |
I see that you're asserting that these are dart only changes. I wonder if there could be some part of your gradle configuration which is changing the .dex files on every build? One way to test for that would be to run |
We definitely could/should provide more information when .dex files differ: #2226 |
App ID: 3fd68888-654c-4831-abbc-d9e2fc4000a0
Description
I am encountering an issue where shorebird patch android fails, stating that there are native changes detected, despite:
• No modifications in the android/ or ios/ directories.
• Using the same Flutter and Shorebird versions as the original release.
• All dependencies being locked in pubspec.yaml and pubspec.lock.
• The same shorebird release android command being used successfully in previous builds.
Steps To Reproduce
Initial Release: Successfully release an Android version using:
shorebird release android
--flutter-version=3.24.5
--flavor production
--target ./lib/main_prod.dart
Make Dart-Only Changes: Modify only Dart code (e.g., UI logic, business logic, etc.), ensuring no native dependency changes.
source $CM_ENV
echo "ANDROID_VERSION:$ANDROID_VERSION"
echo "IOS_VERSION:$IOS_VERSION"
shorebird patch android
--target lib/main_prod.dart
--flavor production
--release-version="$ANDROID_VERSION"
4. Issue Occurs: Shorebird refuses to patch, stating native changes detected. although it works for ios but for android it says
✓ Building patch with Flutter 3.24.5 (3faf56aafa) (365.0s)
⠋ Verifying patch can be applied to release...
✓ Verifying patch can be applied to release (51ms)
[WARN] Your app contains native changes, which cannot be applied with a patch.
Changed files:
base/dex/classes.dex
base/dex/classes2.dex
If you don't know why you're seeing this error, visit our troubleshooting page at https://docs.shorebird.dev/troubleshooting
Instance of 'UnpatchableChangeException'
Expected Behavior
Shorebird should allow Dart-only patches if there are no native changes in android/ or ios/.
Actual Behavior
Shorebird detects false native changes and prevents patching.
Additional Notes
• If there’s any known workaround for this, please let me know.
• If required, I can provide additional debug logs or try experimental fixes.
• I am using code magic.
The text was updated successfully, but these errors were encountered: