flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

Unable to edit new flutter plugin Android side with Android Studio without linter errors as flutter libraries are not recognized. #7152

Open iigori opened 10 months ago

iigori commented 10 months ago

Steps to Reproduce

image

Android studio: Android Studio Hedgehog | 2023.1.1 Build #AI-231.9392.1.2311.11076708, built on November 9, 2023 Runtime version: 17.0.7+0-b2043.56-10550314 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

Non-Bundled Plugins: Dart (231.9409) io.flutter (77.1.2)

Version info

[√] Flutter (Channel stable, 3.16.4, on Microsoft Windows [Version 10.0.22631.2861], locale en-FI) • Flutter version 3.16.4 on channel stable at d:\sdk\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2e9cb0aa71 (8 days ago), 2023-12-11 14:35:13 -0700 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\user\AppData\Local\Android\sdk • Platform android-34, build-tools 34.0.0 • ANDROID_SDK_ROOT = C:\Users\user\AppData\Local\Android\sdk • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.6) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.7.34221.43 • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.1) • Android Studio at C:\Program Files\Android\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 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.85.1) • VS Code at C:\Users\jonne\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.78.0

[√] Connected device (4 available) • SM A047F (mobile) • R58T92CFPDJ • android-arm64 • Android 13 (API 33) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.2861] • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.110 • Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.77

[√] Network resources • All expected network resources are available.

• No issues found!

PatriceThebault commented 8 months ago

Have you been to find out the issue? I have the same.

iigori commented 8 months ago

No. I just hope some update will fix it.

kiratheone commented 8 months ago

Still appears on latest Android Studio and Flutter.

bimusiek commented 7 months ago

Same issue and no solution yet.

YarosMallorca commented 5 months ago

How to fix this??

bimusiek commented 5 months ago

We have tried to debug it by removing more and more dependencies but that did not help. Funny thing is that it it not flutter related, we are building React Native app and it fails with the same issue. No debug information. Using gradlew from command line works, using adb works. Only Android Studio fails. One of the packages has to be a culprit but we were unsuccessful in finding which one.

Zhuinden commented 5 months ago

Same issue, no idea what's causing it yet.

Internet says that in Giraffe, this used to work. https://stackoverflow.com/a/78255814/2413303

But that alone did not work. Based on https://youtrack.jetbrains.com/issue/KTIJ-23971/IDE-Gradle-import-Exception-during-working-with-external-system-java.lang.AssertionError-with-symlinks-and-React-Native#focus=Comments-27-8101997.0-0 it is possible to replace includeBuild in settings.gradle with

includeBuild(file("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle").toPath().toRealPath().toAbsolutePath().toString())

This works in Android Studio Giraffe.