Skip to content

Build for AS canary #5868

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
Dec 1, 2021
Merged

Build for AS canary #5868

merged 2 commits into from
Dec 1, 2021

Conversation

stevemessick
Copy link
Member

@jwren

The flutter-intellij-community.iml file is needed to work on the plugin with Android Studio sources.

The studio-specific source trees for io.flutter.project and io.flutter.module were obsolete. They had to be deleted due to API changes.

The versions all build correctly. The canary version does not work because of a class-not-found error (but it does work in the debugger). The class (org.jetbrains.idea.maven.wizards.MavenWizardBundle) is defined in the flutter-studio module but it is not found by the Jetbrains-specific NPW code. I'm not sure how to fix that yet; it looks like we'd need to insert something onto the classpath of a module that we don't control. Maybe @alexander-doroshko has some suggestion how to do that? As far as I can tell, the missing class is distributed with IntelliJ but not Android Studio. Normally, Android Studio would not need it. It is used by the IntelliJ NPW framework that the Flutter plugin uses for project creation.

@google-cla google-cla bot added the cla: yes label Nov 23, 2021
@alexander-doroshko
Copy link
Contributor

The behavior of the class loaders has become stricter. Each plugin has its own class loader. Class loaders have strict hierarchy. ClassNotFound may happen even if the class is available in some jar but not available for the class loader in use.

It works differently when running from sources (a single class loader for all the classes), ClassNotFound usually doesn't happen in this case.

To analyze ClassNotFound problem, first of all we need to find the JAR file in the IDE installation in which the corresponding class is located.

Then we need to see the whole stack trace and analyze in which JAR each class is located. As I understand, classes from Maven plugin will never be available to the Flutter plugin's class loader because Flutter plugin doesn't depend on Maven plugin. 'Legal' use cases should never lead to such situation.

Please email me the stack trace, describe how IDE is started in this experiment and any other info that you think may be useful to analyze the problem. The problem might be not related to class loaders at all.

@stevemessick
Copy link
Member Author

Thanks for the suggestion @alexander-doroshko. I found the jar file; it is part of the maven plugin, which is not distributed with Android Studio. As an experiment, I copied the maven plugin from IntelliJ, dropped it into Android Studio, and now the NPW works. So, I'm still not sure how to fix the problem, but I understand it a bit better.

@stevemessick
Copy link
Member Author

This is ready for review. The AS canary build is not working yet. I'm consulting with the Android Studio team on potential resolutions for that, so no ETA for canary support yet.

@stevemessick stevemessick requested a review from jwren November 30, 2021 16:49
@stevemessick stevemessick changed the title [WIP] Build for AS canary Build for AS canary Nov 30, 2021
@stevemessick stevemessick merged commit 6350cf8 into master Dec 1, 2021
@stevemessick stevemessick deleted the build-as-canary branch December 1, 2021 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants