[BUG] Compile error: 'Badge' imported twice #684

Closed
opened 2026-02-04 21:53:43 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @tbleiker on GitHub (Feb 11, 2023).

The bug

When debugging the mobile app with VSCode, the following error occurs:

ERROR: lib/modules/home/ui/home_page_app_bar.dart:119:21: Error: 'Badge' is imported from both 'package:badges/src/badge.dart' and 'package:flutter/src/material/badge.dart'.
home_page_app_bar.dart:119
ERROR:                   : Badge(
ERROR:                     ^^^^^
ERROR: Target kernel_snapshot failed: Exception
Exception: Build process failed

I solved it by adding hide Badge to the third line of lib/modules/home/ui/home_page_app_bar.dart:

import 'package:flutter/material.dart' hide Badge;

The OS that Immich Server is running on

Linux, Arch (build environment)

Version of Immich Server

Version of Immich Mobile App

ad93733 (newest commit)

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

-

Your .env content

-

Reproduction steps

1. Pull repo
2. Open folder "mobile" in VSCode
3. Run debug

Additional information

No response

Originally created by @tbleiker on GitHub (Feb 11, 2023). ### The bug When debugging the mobile app with VSCode, the following error occurs: ``` ERROR: lib/modules/home/ui/home_page_app_bar.dart:119:21: Error: 'Badge' is imported from both 'package:badges/src/badge.dart' and 'package:flutter/src/material/badge.dart'. home_page_app_bar.dart:119 ERROR: : Badge( ERROR: ^^^^^ ERROR: Target kernel_snapshot failed: Exception Exception: Build process failed ``` I solved it by adding `hide Badge` to the third line of `lib/modules/home/ui/home_page_app_bar.dart`: ``` import 'package:flutter/material.dart' hide Badge; ``` ### The OS that Immich Server is running on Linux, Arch (build environment) ### Version of Immich Server - ### Version of Immich Mobile App ad93733 (newest commit) ### Platform with the issue - [ ] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML - ``` ### Your .env content ```Shell - ``` ### Reproduction steps ```bash 1. Pull repo 2. Open folder "mobile" in VSCode 3. Run debug ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Feb 11, 2023):

We are still on version 3.3.10 of Flutter. I assume you are using Flutter 3.7? I am working on a PR to move to 3.7, it might be merged today

@alextran1502 commented on GitHub (Feb 11, 2023): We are still on version 3.3.10 of Flutter. I assume you are using Flutter 3.7? I am working on a PR to move to 3.7, it might be merged today
Author
Owner

@tbleiker commented on GitHub (Feb 12, 2023):

I see. Yes, I am using 3.7.1.

@tbleiker commented on GitHub (Feb 12, 2023): I see. Yes, I am using 3.7.1.
Author
Owner

@tbleiker commented on GitHub (Feb 12, 2023):

Fixed with the commit 09ab06a. @alextran1502 thx for all your work!

@tbleiker commented on GitHub (Feb 12, 2023): Fixed with the commit 09ab06a. @alextran1502 thx for all your work!
Author
Owner

@kiyasser commented on GitHub (Mar 24, 2023):

thank you

@kiyasser commented on GitHub (Mar 24, 2023): thank you
Author
Owner

@MohamedWageh1 commented on GitHub (Oct 7, 2023):

i face the same problem but i hadn't import any package of them . what should i do?

@MohamedWageh1 commented on GitHub (Oct 7, 2023): i face the same problem but i hadn't import any package of them . what should i do?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#684