Unable to resolve imports from Android Support Repository
See original GitHub issueI used the Android SDK Manager to install the Android Support Repository. When I now try to import something from there (e.g. android.support.v4.content.LocalBroadcastManager
) into the Android app of my Flutter app, IntelliJ is unable to resolve it:
Cannot resolve Symbol 'LocalBroadcastManager'
The app compiles just fine with that import though. I played around a little with the “Project Structure…” settings, but without much success. It seems like there is no jar for the Android Support Repository on disk that I can include.
Would be nice to document how you can add and use stuff from the Android SDK with the new “Editing Android code in IntelliJ IDEA” support in IntelliJ with Flutter.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Unable to resolve imports from Android Support Repository ...
I suspect that you have to add the full version code, for example: compile 'com.android.support:appcompat-v7:27.0.0' compile ...
Read more >Java – Android Studio: Can't resolve imports (android.support.*)
Yes, there's an entry for Maven in the "build.gradle" file that is directly in the project folder. The "app" gradle file: apply plugin:...
Read more >Add build dependencies - Android Developers
Learn how to add build dependencies using the Gradle build system in Android Studio.
Read more >Support Library Setup - Android Developers
You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.* ) will remain available...
Read more >Known issues with Android Studio and Android Gradle Plugin
To fix this issue, upgrade your Android 11 emulator to version 9 or higher by navigating to Tools > SDK Manager. In the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried to reproduce this, and I think the issue is with how we set up the projects, as well as a little hiccup with Android dependencies.
Here’s what I did:
flutter create foo
foo/android
in IDEA. Let it import the project from Gradle.compile 'com.android.support:support-v4:25.3.1' dependency in
android/app/build.gradle`.At this point, I would normally expect a Gradle sync in IDEA to pick up the added dependency and just work, but it didn’t. I actually had to
After that,
LocalBroadcastManager
(and whatever else I wanted from support) was available in IDEA.So, looks like the Android dependencies are fetched from the
android/build
directory, sinceLocalBroadcastManager
stopped working in the IDE when I removed that directory.I don’t think we should try to work around this, and if we do, it should only be temporary until this issue is fixed upstream.
Also note that I didn’t open
foo/
in IDEA. That project doesn’t look like it’s set up correctly for native Android development. In particular, it doesn’t look like it uses Gradle, and it didn’t pick up the new dependency even after I’d built the project.Fixed with https://github.com/flutter/flutter-intellij/pull/1782