question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

flutter plugin project is missing Android features

See original GitHub issue

Steps to Reproduce

  1. Install Flutter plugin into Android Studio 3.0
  2. File > New Flutter project
  3. Pick either ‘application’ or ‘plugin’ template, and complete creation wizard
  4. After creation is complete, expand the top-level android folder

=> android features are missing

  • no Gradle Scripts top-level folder
  • no res folder, so no way to add resources
  • code analysis fails, for example:
  1. Open src/main/java/<org id>/plugin.java
  2. Add the import import android.support.v4.app.NotificationCompat;
  3. Add a Builder variable:
    • In an app: Add a new line inside the MainActivity class containing NotificationCompat.Builder builder;
    • In a plugin: Add a new line above result.success... containing NotificationCompat.Builder builder;

=> still complains that it can’t resolve the NotificationCompat symbol

If you try the same steps in a regular Android project, it works fine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
mit-mitcommented, Feb 22, 2018

Confirmed that the following now works:

  1. flutter create foobar
  2. Start Android Studio
  3. File > Open, select foobar/android (the android part is important!)
  4. Invoke Build > Make Project
  5. Open MainActivity.java and add import android.support.v4.app.NotificationCompat;

=> will now see the error mentioned at the top of this bug. That is by-design; we need to tell gradle where it’s located

  1. Expand ‘Gradle Scripts’ in the file pane, and open build.gradle (Module: app)
  2. Add compile 'com.android.support:support-v4:+' under dependencies at the bottom
  3. Save file, and accept the request to do a gradle sync

=> import should resolve

0reactions
stevemessickcommented, Feb 21, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Option to create a new Flutter project is missing after upgrade ...
After upgrading Android Studio to (3.4) and my Flutter Plugin to (38.2.1), the option to create a new project is missing from the...
Read more >
Integrate a Flutter module into your Android project
The Android Studio plugin automatically configures your Android project to add your Flutter module as a dependency, and your app is ready to...
Read more >
Install and configure the NDK and CMake - Android Developers
Note: If you have an NDK installed in the ndk-bundle folder, it appears in the list with the label NDK. If you are...
Read more >
File > Project Structure is missing for Flutter ... - Issue Tracker
Thank you for the feedback. For issues related to Flutter in Android Studio, please file an issue with the Flutter team at https://github.com/flutter/flutter- ......
Read more >
Set up Google Play services
Note: Android Studio projects contain a top-level build.gradle file and a build.gradle file for each module. Be sure to edit the file for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found