Android Studio plug-in development stepped on the pit

1、Plugin 'Plugin display name here' is incompatible with this installation

After writing the plug-in, export the plug-in to the local, and then use Android Studio to install the plug-in, it will prompt "Plugin 'Plugin display name here' is incompatible with this installation", which means the version is incompatible; the solution is to open the plugin.xml file of the plug-in project ,turn up

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
 <!-- This sentence means the minimum supported ide version, See the version correspondence provided by the link above, the version ide version of android studio 1.3 is 141 , then we use 141 as the minimum supported version -->
 <idea-version since-build= "141.0" />

This line of code is to set the minimum ide version supported by the plugin. See the comments to know the version correspondence on the page http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html , such as: the ide version of android studio 1.3 is 141, so if we want the minimum supported Android Studio version to be 1.3, set the ide version here to 141.

2、java.lang.NullPointerException

 at com.intellij.ide.SystemHealthMonitor.getActionName

Write the plug-in, export the plug-in to the local, and then use Android Studio to install the plug-in, prompting "java.lang.NullPointerException at com.intellij.ide.SystemHealthMonitor.getActionName", from the reference link , the specific reason is unknown, but the solution is to add All Action and other Java files are placed under the package, not directly under the src directory.

3、classnotfoundexception: gherkin.deps.com.google.gson......

Write the plug-in, export the plug-in to the local, and then use Android Studio to install the plug-in, prompt classnotfoundexception: gherkin.deps.com.google.gson... Depressed for a long time, because I referenced the com.google.gson package, but What kind of package is gherkin.deps.com.google.gson? I always thought it was added by IDE itself when compiling or importing it. After a long time, I found out that this is the gson package that comes with the IDE plugform sdk for developing plug-ins. , there is a place in the code that references the classes under this package (it should actually refer to the com.google.gson package, which was wrong at the time), however, Android Studio does not seem to provide the package gherkin.deps.com.google.gson , so it will always prompt that the package cannot be found, which will eventually cause the plugin to install abnormally. Finally, delete the reference to the gherkin.deps.com.google.gson package in the plug-in project, replace it with the reference under the com.google.gson package, recompile, export and install, and it is successful.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325988467&siteId=291194637