2
votes

My Flutter app throws an error when I am trying to run it.

Compiler message: org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: 'context'. context ^^^^^^^

org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: 'initialDate'. initialDate ^^^^^^^^^^^

Compiler failed on F:\FlutterProjects\myDemoProject\lib\main.dart Finished with error: Gradle task assembleDebug failed with exit code 1

It was running before few minutes. I have not changed anything inside the main.dart even thought it is throwing exception form main.dart. Below is my main.dart.

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new CupertinoApp(
    title: 'App Name',
    home: new RootPage(),
    routes: <String, WidgetBuilder>{
      '/home': (BuildContext context) => new Dashboard(),
      '/signin': (BuildContext context) => new LoginPage(),
    });
  }

OS: Windows 10 IDE: Android Studio

Please help

1
Try cleaning the project. In cmd navigate to your project root and try flutter cleanBlasanka
What about restart the Android Studio and re-open the project...?Fellipe Sanches
I invalidated the cash and restarted the android studio but it did not resolve the issue. The flutter clean I will try today.Sam
@Blasanka flutter clean worked for me. Thanks everyone for your time and help!Sam

1 Answers

3
votes

Try running flutter clean in the root directory of your flutter project. This did the trick for me.