Flutter-intellij: Cannot find declaration to go to

Created on 22 Jun 2018  Â·  15Comments  Â·  Source: flutter/flutter-intellij

Thanks for the feedback! If your issue is related to the Flutter framework itself,
please open an issue at
github.com/flutter/flutter.

Steps to Reproduce

When Ctrl + Click ,ide shows : Cannot find declaration to go to
image

Version info

Please paste the output of running flutter doctor -v here (available from the command
line or from Tools > Flutter > Flutter Doctor). It will provide the version of the
Flutter framework as well as of the IntelliJ plugin.

[√] Flutter (Channel dev, v0.5.5, on Microsoft Windows [Version 10.0.16299.15], locale zh-CN)
    • Flutter version 0.5.5 at D:\FlutterSDK\flutter
    • Framework revision 020e0ef55c (8 days ago), 2018-06-14 13:17:08 -0700
    • Engine revision c3976b3c71
    • Dart version 2.0.0-dev.61.0.flutter-c95617b19c

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at D:\AndroidSDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = D:\AndroidSDK
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 23.2.1
    • Dart plugin version 171.4424
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2018.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.1
    • Flutter plugin version 25.0.2
    • Dart plugin version 181.4203.498

[√] Connected devices (1 available)
    • G8142 • CB512EEZUJ • android-arm64 • Android 8.0.0 (API 26)

• No issues found!
bug

Most helpful comment

emmm... I think I solve it.

  • 1.close your project
  • 2.delete .idea folder and *.iml files in root path
  • 3.open your project

and then i found the *.iml not generated again.

All 15 comments

emmm... I think I solve it.

  • 1.close your project
  • 2.delete .idea folder and *.iml files in root path
  • 3.open your project

and then i found the *.iml not generated again.

@aolose have you solved this problem? I do that as you describe , just can not open my project as a normal flutter project.

emmm... I think I solve it.

  • 1.close your project
  • 2.delete .idea folder and *.iml files in root path
  • 3.open your project

and then i found the *.iml not generated again.

It's not working for me. And the strange thing is other flutter projects are unaffected for now.

not solved issue, reopen please

For people seeing this issue, I would:

  • ensure that a flutter sdk is configured in the settings, Language & Frameworks > Flutter page
  • try the File > Invalidate caches menu item

@Diaglyonok: does @devoncarew's suggestion work for you?

@Diaglyonok: does @devoncarew's suggestion work for you?

No, this is not helps, I found only one solution - recreating the project, but after adding some dependency to pubspec.yaml it repeats again.

Seems that one of the following actions (or their combination) solves the problem:
1) having a good git ignore call git clean -xffd
My gitignore: https://gist.github.com/Diaglyonok/64adccaf923dc6c7522cab1e89a2fe15
2) switching flutter channel to any other and back.
Commands example (if current channel is stable):
flutter channel dev
flutter pub get
flutter channel stable

after any of these actions:
flutter pub get
flutter clean
flutter run ...

Since this problem does not always appear, at the moment I cannot test these solutions again, if you have such a problem, try this solution and report the result, please.

solution, that i suggested above (first) just tested and it worked for me again.

Here's my output from the doctor.... Did a consistent solution ever appear? Thank you!

C:UsersBlake>flutter doctor -v
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.18362.175], locale en-US)
• Flutter version 1.5.4-hotfix.2 at C:srcflutter
• Framework revision 7a4c33425d (9 weeks ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at C:UsersBlakeAppDataLocalAndroidsdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• Java binary at: C:Program FilesAndroidAndroid Studiojrebinjava
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.

[√] Android Studio (version 3.4)
• Android Studio at C:Program FilesAndroidAndroid Studio
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] IntelliJ IDEA Community Edition (version 2018.2)
• IntelliJ at C:Program Files (x86)JetBrainsIntelliJ IDEA Community Edition 2018.2
• Flutter plugin version 31.3.2
• Dart plugin version 182.3569.4

[√] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at C:Program FilesJetBrainsIntelliJ-CE-2018.3.4
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270

[√] VS Code (version 1.35.1)
• VS Code at C:UsersBlakeAppDataLocalProgramsMicrosoft VS Code
• Flutter extension version 3.2.0

[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!

same problem for me, any new solution?

stopping Onedrive autosync solved the problem for me , i dont know why, how, or what's going on

I am still having this problem with 1.17.4

I had this issue, but removing the root project .iml fixed it.

Delete .dart_tool folder from your project root directory.

Was this page helpful?
0 / 5 - 0 ratings