Skip to content
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

[web]: <Flutter build web error> #47692

Closed
CoderJerry opened this issue Dec 23, 2019 · 5 comments
Closed

[web]: <Flutter build web error> #47692

CoderJerry opened this issue Dec 23, 2019 · 5 comments

Comments

@CoderJerry
Copy link

CoderJerry commented Dec 23, 2019

My code is running fine while debugging means it runs fine with "flutter run -t lib\main_dev.dart -d chrome"

but when i m trying to build the webapp with
"flutter build web -t lib\main_dev.dart"

i am getting following error in console.

how to get pass to this error

Target dart2js failed: Exception: lib/injection_container.dart:108:44:
Error: A value of type 'AuthRepoImpl' can't be assigned to a variable of type 'AuthRepo'.
 - 'AuthRepoImpl' is from 'lib/data/repositories/auth_repo.dart'.
 - 'AuthRepo' is from 'lib/domain/repositories/auth_repo.dart'.
  sl.registerLazySingleton<AuthRepo>(() => AuthRepoImpl());
                                           ^
lib/injection_container.dart:109:45:
Error: A value of type 'AdminRepoImpl' can't be assigned to a variable of type 'AdminRepo'.
 - 'AdminRepoImpl' is from 'lib/data/repositories/admin_repo.dart'.
 - 'AdminRepo' is from 'lib/domain/repositories/admin_repo.dart'.
  sl.registerLazySingleton<AdminRepo>(() => AdminRepoImpl(sl(), sl()));
                                            ^
lib/injection_container.dart:111:13:
Error: A value of type 'ManagerRepoImpl' can't be assigned to a variable of type 'ManagerRepo'.
 - 'ManagerRepoImpl' is from 'lib/data/repositories/manager_repo.dart'.
 - 'ManagerRepo' is from 'lib/domain/repositories/manger_repo.dart'.
      () => ManagerRepoImpl(sl(), sl(), sl()));
            ^
lib/injection_container.dart:112:44:
Error: A value of type 'LeadRepoImpl' can't be assigned to a variable of type 'LeadRepo'.
 - 'LeadRepoImpl' is from 'lib/data/repositories/lead_repo.dart'.
 - 'LeadRepo' is from 'lib/domain/repositories/lead_repo.dart'.
  sl.registerLazySingleton<LeadRepo>(() => LeadRepoImpl(sl(), sl(), sl()));
                                           ^
lib/injection_container.dart:115:13:
Error: A value of type 'ConsultantRepoImpl' can't be assigned to a variable of type 'ConsultantRepo'.        
 - 'ConsultantRepoImpl' is from 'package:resolve_dashboard/data/repositories/consultant_repo.dart'
 ('lib/data/repositories/consultant_repo.dart').
 - 'ConsultantRepo' is from 'lib/domain/repositories/consultant_repo.dart'.
      () => ConsultantRepoImpl(sl(), sl(), sl()));
            ^
lib/injection_container.dart:121:51:
Error: A value of type 'FunctionsImpl' can't be assigned to a variable of type 'FunctionService'.
 - 'FunctionsImpl' is from 'package:resolve_dashboard/data/data_sources/functions.dart'
 ('lib/data/data_sources/functions.dart').
 - 'FunctionService' is from 'lib/data/data_sources/function_contract.dart'.
  sl.registerLazySingleton<FunctionService>(() => FunctionsImpl());
                                                  ^
lib/domain/usecases/auth/sign_in.dart:22:31:
Error: The argument type 'UcSignInParams/*1*/' can't be assigned to the parameter type 'UcSignInParams/*2*/'.
 - 'UcSignInParams/*1*/' is from 'lib/domain/usecases/auth/sign_in.dart'.
 - 'UcSignInParams/*2*/' is from 'package:resolve_dashboard/domain/usecases/auth/sign_in.dart'
 ('lib/domain/usecases/auth/sign_in.dart').
    return await _repo.signIn(params);
                              ^
lib/domain/usecases/consultant/get_consultations.dart:33:56:
Error: The argument type 'UcMyAssignedConsultationsParam/*1*/' can't be assigned to the parameter type
'UcMyAssignedConsultationsParam/*2*/'.
 - 'UcMyAssignedConsultationsParam/*1*/' is from 'lib/domain/usecases/consultant/get_consultations.dart'.
 - 'UcMyAssignedConsultationsParam/*2*/' is from
 'package:resolve_dashboard/domain/usecases/consultant/get_consultations.dart'
 ('lib/domain/usecases/consultant/get_consultations.dart').
    return await repository.getMyAssignedConsultations(params);
                                                       ^
lib/domain/usecases/lead/get_consultations.dart:33:50:
Error: The argument type 'UcGetConsultationsParam/*1*/' can't be assigned to the parameter type
'UcGetConsultationsParam/*2*/'.
 - 'UcGetConsultationsParam/*1*/' is from 'lib/domain/usecases/lead/get_consultations.dart'.
 - 'UcGetConsultationsParam/*2*/' is from 'package:resolve_dashboard/domain/usecases/lead/get_consultations.dart'
 ('lib/domain/usecases/lead/get_consultations.dart').
    return await repository.getLeadConsultations(params);
                                                 ^
lib/presentation/bloc/admin_bloc/widgets/add_partner_widgets/add_partner_button_widget.dart:13:12:
Error: Type argument 'AdminBloc' doesn't conform to the bound 'Bloc<dynamic, S>' of the type variable 'B' on
'BlocBuilder'.
 - 'AdminBloc' is from 'lib/presentation/bloc/admin_bloc/admin_bloc.dart'.
 - 'Bloc' is from 'package:bloc/src/bloc.dart'
 ('/C:/Users/visha/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/bloc-2.0.0/lib/src/bloc.dart').
    return BlocBuilder<AdminBloc, AdminState>(
           ^
/C:/Users/visha/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_bloc-2.1.1/lib/src/bloc_builder.dart:71:19:     
Info: This is the type variable whose bound isn't conformed to.
class BlocBuilder<B extends Bloc<dynamic, S>, S> extends BlocBuilderBase<B, S> {
                  ^
lib/presentation/bloc/admin_bloc/widgets/add_partner_widgets/add_partner_button_widget.dart:27:21:
Error: The argument type 'EvAddPartner' can't be assigned to the parameter type 'AdminEvent'.
 - 'EvAddPartner' is from 'package:resolve_dashboard/presentation/bloc/admin_bloc/admin_event.dart'
 ('lib/presentation/bloc/admin_bloc/admin_event.dart').
 - 'AdminEvent' is from 'lib/presentation/bloc/admin_bloc/admin_event.dart'.
                    EvAddPartner(
                    ^
Error: Compilation failed.

This is flutter doctor summery

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.12.13+hotfix.6, on Microsoft Windows [Version 10.0.18362.535], locale en-IN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 3.4)
[√] VS Code, 64-bit edition (version 1.41.0)
[√] Connected device (2 available)
@uberscott
Copy link

Android Studio is renaming your packages in some places incorrectly.

Search for package:resolve_dashboard/domain/usecases/lead/get_consultations.dart and change it to lib/domain/usecases/lead/get_consultations.dart'

That will fix ONE of your errors, but the rest follow a similar pattern.

@CoderJerry
Copy link
Author

@uberscott that problem is solved but the issue is when I m trying to assign a concrete class object to ist abstract class in getIt locator

@CoderJerry
Copy link
Author

after changing every import to relative format it resolves my problem

@SlickSlime
Copy link

SlickSlime commented Dec 26, 2019

Isn't this still inconsistent and inconvenient? Anyways why is this happening?

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants