Jay Dee
Jay Dee

Reputation: 2646

Change external annotations folder in Android Studio 2.2.3

I set the folder for external annotation once in my Android studio. Now, I wanted to change the folder location, following https://www.jetbrains.com/help/idea/2016.3/using-external-annotations.html#d2150916e113 guideline. However, there is no Paths tab...

Does anyone know how to do it? Any config file... whatever!

enter image description here

Upvotes: 2

Views: 632

Answers (3)

PD232
PD232

Reputation: 21

Android Studio saves it globally, if you want to change it or remove it, close your Android Studio and follow this:

You can search for annotationsPath in

C:\Users\ USER ACCOUNT NAME \.AndroidStudio3.0\config\options\jdk.table.xml

If using another Android Studio version, look for a similar folder.

Inside the jdk.table.xml file, look for it:

    <annotationsPath>
      <root type="composite">
        <root type="simple" url="jar://$APPLICATION_HOME_DIR$/plugins/android/lib/androidAnnotations.jar!/" />
        <root type="simple" url="file://..." />
      </root>
    </annotationsPath>

And change the url="file://... there, or delete the <root type="simple" url="file://..." /> line and Android Studio will ask again next time when needed.

Upvotes: 1

Pod
Pod

Reputation: 4130

I had this same problem, and the other answer didn't help me -- I couldn't find <annotation-paths> anywhere in an .iml file and couldn't find a part of the settings gui to change this.

I noticed that Android Studio would ask me to create a new directory tree for annotations from different libraries. So after hunting around, I found that in <project>/.idea/libraries/<libname>.xml there are <ANNOTATIONS> tags that can be changed.

For most libraries this worked, however I couldn't find any file or <ANNOTATIONS> for the actual classes in the Android SDK.

Upvotes: 1

Rajan Prasad
Rajan Prasad

Reputation: 1679

With reference to this, https://blog.jetbrains.com/idea/2008/02/external-annotations/ I also faced this problem that there is no Paths tab in the Annotations area in the module settings as mentioned in this page.

However, you can edit the .iml in your module folder or .iml in your project folder, depending on whether you want to have externally stored annotations for only a specific module or entire project.

The annotation-paths tag is the one you need to edit.
<annotation-paths> <root url="file://$MODULE_DIR$" /> </annotation-paths>

Upvotes: 3

Related Questions