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

Cannot find declaration to go to #2404

Open
aolose opened this issue Jun 22, 2018 · 28 comments
Open

Cannot find declaration to go to #2404

aolose opened this issue Jun 22, 2018 · 28 comments
Labels
Milestone

Comments

@aolose
Copy link

aolose commented Jun 22, 2018

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!
@aolose
Copy link
Author

aolose commented Jun 22, 2018

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.

@StarJiao
Copy link

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

@baoxiehao
Copy link

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.

@Diaglyonok
Copy link

not solved issue, reopen please

@aolose aolose reopened this Apr 9, 2019
@devoncarew
Copy link
Member

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

@pq
Copy link
Contributor

pq commented Apr 15, 2019

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

@pq pq added the bug label Apr 15, 2019
@pq pq added this to the On Deck milestone Apr 15, 2019
@Diaglyonok
Copy link

Diaglyonok commented Apr 15, 2019

@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.

@Diaglyonok
Copy link

Diaglyonok commented Apr 17, 2019

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.

@Diaglyonok
Copy link

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

@blakesaradad
Copy link

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

C:\Users\Blake>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:\src\flutter
• 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:\Users\Blake\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• 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 Files\Android\Android 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)\JetBrains\IntelliJ 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 Files\JetBrains\IntelliJ-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:\Users\Blake\AppData\Local\Programs\Microsoft 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!

@evalsxonted
Copy link

same problem for me, any new solution?

@evalsxonted
Copy link

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

@vanlooverenkoen
Copy link

I am still having this problem with 1.17.4

@hacker1024
Copy link

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

@elias8
Copy link

elias8 commented Oct 19, 2020

Delete .dart_tool folder from your project root directory.

@efraespada
Copy link

Same issue here when updating to Flutter 2

@efraespada
Copy link

I noticed my problem was a local dependency added to my project:

dependencies:
  random_name:
    path: ../random_name

Using the git integration solved my problem.

dependencies:
  random_name:
    git:
      url: https://github.com/efraespada/random_name.git

But it is crazy how a simple dependency can block/break your project indexation.

@duzenko

This comment has been minimized.

@AurelienDud
Copy link

New day, new flutter bug
Just bumped into this, seemingly caused by a specific widget tree

Not a Flutter bug. I'm also looking for a fix of this problem... but i'm using React-Native (Android files in Java). 😏

@MikePendo
Copy link

Same issue Channel stable, 3.3.3 (Android) Android Studio (version 4.1)

@chloeeee72
Copy link

Same issue Channel stable,3.3.8

@chloeeee72
Copy link

flutter pub get

it works for me!!!! thanks

@AhhhhDong
Copy link

bug
the useless 'required' will make bug...

@fuadreza
Copy link

I have similar bug. For me it is because i use Records. Strangely bug only appear on the line after the Records line.

image

But after I change the record into single type, I able to go to any declaration.
image

Hope this info helps.

@bernaferrari
Copy link

Same problem. It gets worse with Records.

@bernaferrari
Copy link

This is enough to trigger the problem:

Make a file named bug.dart:

import 'package:flutter/widgets.dart';

Widget totalBuilder(List<(String, String)> none) {
  return Container();
}

Reproducible project:
bug.zip

@HieuNghiemViet
Copy link

Does anyone have a solution?

@Arhidev
Copy link

Arhidev commented Jan 11, 2025

same problem for me, I moved my project to another folder, a folder with a nomenclature without an accent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests