How to import OpenMRSFormatter.xml in android studio

I’m facing problem in importing OpenMRSFormatter.xml to android client. I already installed eclipse code formatter and it was written in setup steps that I should import given file on that XML link, but i can see that the XML needs to be import is already set in eclipse formatter config so I think the file is already imported but then according to steps I opened code style>java and code style>xml but first problem is that i can’t OpenMRS Formatter in scheme dropdown then I tried to import that scheme but it showed “IntelliJ IDEA code style XML import failed with error message: The file doesn’t seem to be a valid Intellij IDEA XML scheme, it should contain ‘code_scheme root’ element, found ‘profiles’ instead.” this error, the scheme dropdown is showing only two schemes Project(stored in project) and Default(stored in IDE), So what can i do, give some solution please:).

@saurabh can you explain this to me.

I think you missed the eclipse code formatter step. you should use the eclipse code formatter to import the xml file mentioned there. you should not directly import it from android studio. it worked for me when I started contributing to android client. :slight_smile:

In my eclipse code formatter the file is already imported you can see it in the eclipse formatter config the file was already in project when i cloned it and already got imported when i installed eclipse code formatter.

1 Like

yes this is setup correctly you should get an option there apart from 2 default ones. automatically after this step. you cant import the xml file there from the codestyles tab since its not compatible with Intellij thats actually the whole point in using the eclipse code formatter. It should work for you did you try invalidating caches and restarting.

can you tell me how can i invalidate cach?

file menu -> invalidate caches and restart

yeah just got it thanks i test that and then will give you reply:).

Hey i invalidated cache and restarted it but OpenMRS Formatter is not appearing at code style dropdown, do i have to change any settings in eclipse code formatter except the already imported xml file.

No I think it was good already, if this is not working for you you can use the in project formatter that should be good enough.

1 Like

Ok then i should make the changes needed for openmrs formatter, like that tab space value to 8 and importing class in java, in project formatter then.

btw I will also try removing the formatter and try setting it up again like you but for now this will be enough for you to work on the project :+1:

Okay thanks for all the help man i appreciate that you sticked with me in this 12 now 13 reply long conversation, you’re a good man:).

1 Like