Testing plugin with dependencies and testProject setup with AndroidFacet Follow
Hello,
I am testing my plugin, which takes project having Android facets and do its analysis on the project. While setting up tests, I have added files to the module and tried to check if the project is having Android facets. The result was false.
So I created FacetManager instance
val facetManager = FacetManager.getInstance(firstModule!!)
And tried to create AndroidFacet
val facetType = AndroidFacetType()
val facet = facetManager.createFacet(facetType, facetType.defaultFacetName, null)
But error was Cannot find facet by id 'android'
So, I added org.jetbrains.android dependency in Xml file. I am getting following error:
ERROR: Problems found loading plugins:<p/>Plugin "Gradle" was not loaded: required plugin "org.intellij.groovy" not installed.<p/>Plugin "Android Support" was not loaded: required plugin "JUnit" not installed.<p/>Plugin "KilaCrypto" was not loaded: required plugin "JUnit" not installed.<p/><br><a href="disable">Disable not loaded plugins</a><p/><a href="edit">Open plugin manager</a>
Please sign in to leave a comment.
I have added following code to Plugin.xml
I am still unable to get Android facet. Still getting the AssertionError: Cannot find facet by id 'android'
I have updated the code to setting up module with facets
After debugging,
I have already specified
in my Plugin.xml file.
After the execution of com.intellij.facet.impl#loadExtensions()
Some implementations on github are having
in their workspace.xml.
I have added this manually, just to see the effect, and after this addition, the first run was able to return the Android facet :)
But after restarting the project, getting the same AssertionError: Cannot find facet by id 'android'
> ERROR: Problems found loading plugins:<p/>Plugin "Gradle" was not loaded: required plugin "org.intellij.groovy" not installed.<p/>Plugin "Android Support" was not loaded: required plugin "JUnit" not installed.<p/>Plugin "KilaCrypto" was not loaded: required plugin "JUnit" not installed.<p/><br><a href="disable">Disable not loaded plugins</a><p/><a href="edit">Open plugin manager</a>
Have you tried to add dependencies on Gradle, Groovy, JUnit plugins?
This error has been resolved after I loaded plugins while testing using VM options:
Alexander,
how to resolve the error Cannot find facet by id 'android'?
I have added
<extensions defaultExtensionNs="com.intellij">
<facetType implementation="org.jetbrains.android.facet.AndroidFacetType"/>
</extensions>
Still facing the issue. What am I missing here?
Do you have android plugin enabled in the debugged IDE? Have you tried to debug code that actually leads to the assertion?