flutter / flutter/flutter-intellij
Unable to build project when "android" option is selected
- Dominant language
- Java
- Stars
- 2k
- Forks
- 356
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 27
Description
## Steps to Reproduce
1. Create new project, on target platforms select "Android".
2. Then configure JDK (but no android SDK.. is that needed?)
3. Press the build (green hammer) button
4. See errors:
```
MainActivity.kt
Kotlin: Unresolved reference: embedding
Kotlin: Unresolved reference: FlutterActivity
```
`flutter build apk` appears to work
## Version info
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.1645], locale pl-PL)
• Flutter version 3.3.10 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 135454af32 (5 days ago), 2022-12-15 07:36:55 -0800
• Engine revision 3316dd8728
• Dart version 2.18.6
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at C:\Users\user\AppData\Local\Android\Sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: C:\progsy\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.2)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.8.30717.126
• Windows 10 SDK version 10.0.18362.0
[√] Android Studio (version 2021.3)
• Android Studio at C:\progsy\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[√] IntelliJ IDEA Community Edition (version 2022.2)
• IntelliJ at C:\progsy\IntelliJ IDEA Community Edition 2021.3.3
• Flutter plugin version 71.2.5
• Dart plugin version 222.4167.21
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1645]
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.125
• Edge (web) • edge • web-javascript • Microsoft Edge 100.0.1185.44
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Contributor guide
Research direction
Start by reproducing the Android project build in the Flutter IntelliJ plugin using the listed Flutter, Android SDK, JDK, and IntelliJ versions. Compare the IDE build failure in MainActivity.kt with the successful `flutter build apk` result. Done means a newly created Android-targeted project builds successfully from the IDE without the unresolved Kotlin references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100