Fix example app build on current Flutter - #13
Open
fa0311 wants to merge 1 commit into
Open
Conversation
- Replace io.flutter.app.FlutterApplication with android.app.Application
in the example's MainApplication.kt. The v1 Android embedding class was
removed in Flutter 3.29 (stable), so the example app no longer compiled
on any currently supported Flutter SDK. The SFMC initialization in
onCreate() is unchanged. The same snippet in the Android.md integration
guide is updated to match.
- Add missing braces to the MID placeholder in the example iOS
AppDelegate.m ({MC_MID} instead of MC_MID) so it matches the other
brace-delimited placeholders ({MC_APP_ID}, {MC_ACCESS_TOKEN},
{MC_APP_SERVER_URL}). Previously a brace-targeted find/replace silently
left the literal string "MC_MID" as the business unit MID. The same
snippet in iOS_objc.md is updated to match.
- Replace the stale plugin-template widget test in example/test with a
smoke test that pumps the real example app with the 'sfmc' method
channel mocked and verifies the demo UI renders without exceptions.
The old test asserted a 'Running on:' Text that does not exist in the
app and always failed under 'flutter test'.
- Bump the plugin's own Gradle wrapper from 8.0 to 8.9. The plugin's
android/build.gradle declares AGP 8.6.1, which requires Gradle 8.7+,
so running ./gradlew in android/ failed with 'Minimum supported Gradle
version is 8.7'. Gradle 8.9 matches the example app's wrapper.
nakasyou
approved these changes
Jul 19, 2026
nakasyou
approved these changes
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gets the example app (and the plugin's own gradle wrapper) working on current tooling:
io.flutter.app.FlutterApplicationwas removed in Flutter 3.29, so the example no longer compiles.MainApplicationnow extendsandroid.app.Application; the snippet in Android.md is updated to match.AppDelegate.mwas missing its braces (MC_MIDinstead of{MC_MID}), so a brace-targeted find/replace leaves the literal string behind. Same fix in iOS_objc.md.example/test/widget_test.dartwas still the counter-app template and always failed underflutter test. Replaced with a smoke test that pumps the real app with the method channel mocked.