Closed YasserOJ closed 3 years ago
Did you try to clean and rebuild it? That worked for me.
flutter packages pub run build_runner clean
and then flutter packages pub run build_runner build
Hello, yes I tried it and it still the same
Hey @YasserOJ Can you show me your router setup?
I have the same issue. It doesn't work with functional_widget
package.
[SEVERE] auto_route_generator:autoRouteGenerator on lib/presentation/router.dart:
Error running AutoRouteGenerator
[dynamic] is not a class
I have the same problem and I don't know what cause of it. I guess that some cache. It's difficult to reproduce locally, but in my gitlab-ci always happens.
I tried to run flutter packages pub run build_runner clean
and didn't work for me.
This problem started when I change the relative path of my page widgets.
Example, I change
import 'package:pix/presentation/page/transfer/transfer_feedback/transfer_feedback_page.dart';
to
import 'package:pix/presentation/transfer/transfer_feedback/transfer_feedback_page.dart';
Steps when I reproduce it locally: delete router.g.dart
than run flutter clean
, flutter pub get
then flutter pub run build_runner build --delete-conflicting-outputs
, if i run flutter pub run build_runner build --delete-conflicting-outputs
no error anymore.
my `router.dart``
import 'package:auto_route/auto_route_annotations.dart';
import 'package:pix/presentation//home/home_page.dart';
import 'package:pix/presentation/receive/receive_message/receive_message_page.dart';
import 'package:pix/presentation/receive/receive_page.dart';
import 'package:pix/presentation/receive/receive_qrcode/receive_qrcode_page.dart';
import 'package:pix/presentation/receive/receive_value/receive_value_page.dart';
import 'package:pix/presentation/transfer/transfer_page.dart';
import 'package:pix/presentation/transfer/transfer_feedback/transfer_feedback_page.dart';
import 'package:pix/presentation/transfer/transfer_manual/description/transfer_manual_description_page.dart';
import 'package:pix/presentation/transfer/transfer_manual/account/transfer_manual_account_page.dart';
import 'package:pix/presentation/transfer/transfer_manual/agency/transfer_manual_agency_page.dart';
import 'package:pix/presentation/transfer/transfer_manual/bank_select/transfer_manual_bank_select_page.dart';
import 'package:pix/presentation/transfer/transfer_manual/ownership/transfer_manual_ownership_page.dart';
import 'package:pix/presentation/transfer/transfer_resume/transfer_resume_page.dart';
import 'package:pix/presentation/transfer/transfer_value/transfer_value_page.dart';
@MaterialAutoRouter()
class $Router {
@initial
HomePage homePage;
TransferPage transferPage;
TransferValuePage transferValuePage;
TransferResumePage transferResumePage;
TransferFeedbackPage transferFeedbackPage;
TransferManualBankSelectPage transferManualBankSelectPage;
TransferManualOwnershipPage transferManualOwnershipPage;
TransferManualDescriptionPage transferManualDescriptionPage;
TransferManualAgencyPage transferManualAgencyPage;
TransferManualAccountPage transferManualAccountPage;
ReceivePage receivePage;
ReceiveMessagePage receiveMessagePage;
ReceiveValuePage receiveValuePage;
ReceiveQrcodePage receiveQrcodePage;
}
I got it locally. @Milad-Akarie
for my case, steps:
flutter clean
flutter pub get
flutter pub run build_runner clean
flutter pub run build_runner build --delete-conflicting-outputs
I don't know why but I change the absolute path to relative path and works.
import 'home/home_page.dart';
import 'receive/receive_message/receive_message_page.dart';
import 'receive/receive_page.dart';
import 'receive/receive_qrcode/receive_qrcode_page.dart';
import 'receive/receive_value/receive_value_page.dart';
import 'transfer/transfer_feedback/transfer_feedback_page.dart';
import 'transfer/transfer_manual/account/transfer_manual_account_page.dart';
import 'transfer/transfer_manual/agency/transfer_manual_agency_page.dart';
import 'transfer/transfer_manual/bank_select/transfer_manual_bank_select_page.dart';
import 'transfer/transfer_manual/description/transfer_manual_description_page.dart';
import 'transfer/transfer_manual/ownership/transfer_manual_ownership_page.dart';
import 'transfer/transfer_page.dart';
import 'transfer/transfer_resume/transfer_resume_page.dart';
import 'transfer/transfer_value/transfer_value_page.dart';
Closing issue due to:
Hello, when I am trying to generate the routes for my app using flutter pub run build_runner build
I'm getting an error and the generated class can't be generated I only see [dynamic] is not a class in the generated class