Flutter-intellij: Flutter plugin no auto-completion in IDE

Created on 23 Apr 2018  路  15Comments  路  Source: flutter/flutter-intellij

_From @pauldemarco on June 4, 2017 23:13_

Steps to Reproduce

Create a new plugin:

flutter create --org com.example --plugin hello

Open the new plugin directory with IntelliJ

Navigate to the android folder:

android/src/main/java/com/example/hello/HelloPlugin.java

Attempt to view definition of _MethodCallHandler_

Notice there is no auto-completion or javadoc for these files.

This makes the learning curve just a little steeper for Plugin creation. Anything to ease this process would be beneficial to the Flutter ecosystem.

_Copied from original issue: flutter/flutter#10497_

flutter-plugins

Most helpful comment

I'm having the same issue. And if i open the android module of a plugin i got this:
screenshot_20180828_135300

All 15 comments

_From @pauldemarco on June 4, 2017 23:16_

If I add the following to gradle (module):

compile files('flutter/bin/cache/artifacts/engine/android-arm/flutter.jar')

--then I get code completion, but definitions require decompiling, not pretty

This also has the added trouble of multiple dex errors when flutter run is issued, unless the project is cleaned.

_From @eseidelGoogle on June 5, 2017 3:43_

@skybrian would know. :)

_From @pauldemarco on June 20, 2017 20:1_

Also followed the setup here but still no definitions: https://flutter.io/intellij-ide/#edit-android-code

_From @mit-mit on June 20, 2017 20:2_

cc @devoncarew

_From @devoncarew on June 20, 2017 21:48_

This is still an area where we need to improve (working better with the Java code in a Flutter project). @skybrian has context here, and @stevemessick will likely take a look at it in the future.

_From @skybrian on June 20, 2017 21:54_

I haven't looked at flutter create --plugin at all, so I expect it requires similar changes to the non-plugin templates.

Are there any known workarounds for auto completion and highlighting for plugins at this time?

We are working on a solution here; /cc @stevemessick

@justin-vanwinkle You can navigate in IntelliJ or Android Studio to the android module in the Project view, then use the menu option to open it in Android Studio. We're working on something better.

I'm having the same issue. And if i open the android module of a plugin i got this:
screenshot_20180828_135300

Same Issue. Any update on this ??

There's been some progress, but it is not quite right yet. There's a new-ish option in the Flutter settings to enable completion, etc for Java and Kotlin. Still, the recommended technique is to open the Android module in its own project window (see my previous comment).

Any progress?

@justin-vanwinkle You can navigate in IntelliJ or Android Studio to the android module in the Project view, then use the menu option to open it in Android Studio. We're working on something better.

This is the correct way of doing it. Open the plugin in android studio (you should have the flutter/dart plugin installed),then right click in the project android folder and select flutter>open Android module in android studio. The completion works.

Closing as obsolete. There are two ways to solve the problem:

  • Open the Android module as its own project
  • Enable the option that turns on Gradle syncing and indexing for Kotlin and Java
Was this page helpful?
0 / 5 - 0 ratings