18

I created a new project in Android Studio Bumble Bee. However when I enter some code that has errors in it the error is not showing up.

For example if I enter the following:

import './screens/authorization/auth_root_screen.dart';

When this directory or screen doesn't exist no error is shown.

Or even if I enter some code with a typo...

iiiiiiiiiiiiiiiiiiiiimport './screens/authorization/auth_root_screen.dart';

No error is shown in the IDE.

I guess I am missing a setting somewhere but I havent been able to find it. This always worked fine before I installed BumbleBee.

Any help would be gratefully received.

Thanks so much.

Kitcc
  • 2,138
  • 4
  • 24
  • 42

4 Answers4

77

Hi thanks for looking at this. I have solved it myself. I'll post the solution here in case anyone has a similar question.

Do the following:

  1. At the bottom of the Android Studio IDE is a tab called: Dart Analysis. Click on it to open the tab.

  2. On the left hand side of the Dart Analysis screen that opens is a settings Icon. Click on this.

  3. On the settings screen, make sure that "Scope Analysis to the Current Package" is ticked on.

Here is a screen print:

enter image description here

Dharman
  • 30,962
  • 25
  • 85
  • 135
Kitcc
  • 2,138
  • 4
  • 24
  • 42
  • 6
    What the..? Why would this ever be unticked as a default, let alone ever? One of the more confusingly simple issues I've had. – dwb Jul 12 '22 at 13:32
0

Have you installed the Flutter extension for your Android Studio? You can find it in the Extensions section of your IDE.

  • Well it was installed. Ive been using Android Studio for several years. Not sure if somehow it has now been removed. Where is the Extensions section? – Kitcc Feb 22 '22 at 09:46
  • Actually I think it is installed as if I click on the Dart Analysis tab at the bottom of the screen I see the errors. I just don't see the errors in the main screen of the IDE. – Kitcc Feb 22 '22 at 09:47
0

In my case, this happened while opening a local sub-package that did not have its own analysis options file.

For a Flutter package, you can add one with the following contents:

include: package:flutter_lints/flutter.yaml
rhalff
  • 181
  • 2
  • 4
-1

Come do these things

First, run this Flutter Doctor code in the terminal, be sure to check all the options

Specify the second SDK FLutter for Android Studio

Third, install the Dart and Flutter plugins

  • Yes these have already been checked. The issue isn't with Dart or Flutter. It is with only that Android Studio is not showing code errors in the main screen. – Kitcc Feb 22 '22 at 14:34