Skip to content

Android build fails on Flutter main, in flutter_local_notifications #771

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

Closed
gnprice opened this issue Jun 28, 2024 · 1 comment · Fixed by #777
Closed

Android build fails on Flutter main, in flutter_local_notifications #771

gnprice opened this issue Jun 28, 2024 · 1 comment · Fixed by #777
Assignees
Labels
a-Android Issues specific to Android, or requiring Android-specific work

Comments

@gnprice
Copy link
Member

gnprice commented Jun 28, 2024

@sm-sayedi reported the following error trying to run the app on Android:

C:\Users\mahmo\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_local_notifications-17.1.2\android\src\main\java\com\dexterous\flutterlocalnotifications\FlutterLocalNotificationsPlugin.java:1033: error: reference to bigLargeIcon is ambiguous
      bigPictureStyle.bigLargeIcon(null);
                     ^
  both method bigLargeIcon(Bitmap) in BigPictureStyle and method bigLargeIcon(Icon) in BigPictureStyle match

After some investigation, this is MaikuB/flutter_local_notifications#2329 . It occurs when running a Flutter version from commit flutter/flutter@f23dbc5 up through current main.

For now, the workaround is to use a slightly older Flutter version. For example:

$ cd your/flutter/tree
$ git reset --hard 74688cea3d14954277dd9342d4f9db838eee3050

to get the same commit that's currently our minimum, so the version that was tested when I did the most recent upgrade yesterday.

I pinged the author of the relevant upstream change in the Flutter Discord (in #hackers-android), and he's investigated and has a fix. So probably the package:flutter_local_notifications author will take that fix and make a release, and then we'll upgrade to that.

@gnprice gnprice added the a-Android Issues specific to Android, or requiring Android-specific work label Jun 28, 2024
@gnprice gnprice added this to the Beta 3: Summer 2024 milestone Jun 28, 2024
@gnprice gnprice self-assigned this Jun 28, 2024
@gnprice
Copy link
Member Author

gnprice commented Jun 29, 2024

It looks like there's now a flutter_local_notifications release 17.2.1 which has that fix, so upgrading to that ought to let us also upgrade to the latest Flutter from main.

I won't get to trying that out before next week, but if someone else wants to pick it up sooner then a PR would be welcome. The PR should also include the Flutter upgrade, to demonstrate that they work together; for that, use tools/upgrade flutter-local, as described in the repo's README.

@gnprice gnprice removed their assignment Jun 29, 2024
sm-sayedi added a commit to sm-sayedi/zulip-flutter that referenced this issue Jun 29, 2024
The related flutter_local_notifications_platform_interface plugin is also
upgraded to the latest.

Fixes: zulip#771
@sm-sayedi sm-sayedi self-assigned this Jun 29, 2024
sm-sayedi added a commit to sm-sayedi/zulip-flutter that referenced this issue Jul 1, 2024
(The related flutter_local_notifications_platform_interface plugin is also
upgraded to the latest.)

After the Flutter upstream commit:
  flutter/flutter@f23dbc5
a build error related to flutter_local_notifications plugin occurs when
trying to run the app on Android. The upgrade to flutter_local_notifications ^7.2.0
version resolves the issue.

More about the issue:
  MaikuB/flutter_local_notifications#2329

Fixes: zulip#771
@gnprice gnprice closed this as completed in 2629ccb Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-Android Issues specific to Android, or requiring Android-specific work
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants