Skip to content

🐛 Use reflection for Android Studio IDE info and fallback to application name match #8375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2025

Conversation

AlexV525
Copy link
Member

@AlexV525 AlexV525 commented Jul 25, 2025

Fixes #8374

Tested on IntelliJ IDEA 2025.1.4 and Android Studio Meerkat 2024.3.1.

@AlexV525 AlexV525 requested a review from helin24 July 25, 2025 04:14
Copy link
Member

@helin24 helin24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Lgtm

@@ -89,7 +91,18 @@ public static boolean isDartFile(@NotNull VirtualFile file) {
}

public static boolean isAndroidStudio() {
return IdeInfo.getInstance().isAndroidStudio();
try {
// Try to use `IdeInfo` first by reflecting on it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here that this class should be available either if the user has Android plugin installed or if they are using Android studio?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@helin24
Copy link
Member

helin24 commented Jul 25, 2025

CC @pq @jwren

@helin24
Copy link
Member

helin24 commented Jul 25, 2025

@AlexV525 thanks for all the investigation and testing you did for these changes!

@helin24 helin24 merged commit 9d770c6 into flutter:master Jul 25, 2025
8 checks passed
@AlexV525 AlexV525 deleted the fix/android-dep branch July 25, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NoClassDefFoundError for com/android/tools/idea/IdeInfo
2 participants