4

When I work with my Android Studio it always changes my XML code style settings. The only way to return it is to go to Preferences->Editor->Code style -> XML and select Scheme as Default.

But I do it a lot of times.

This question on StackOverflow doesn't match my problem.

Is anyone know how to fix it? Thanks in advance.

Peter Staranchuk
  • 1,343
  • 3
  • 14
  • 29
  • 1
    What's your Android Studio version? Because since 3.5 I have the same problem. We are storing the `.idea/codeStyles/Project.xml` file in our repository to have a consistent styling and now it's always removing some elements from it like e.g. `` and ``... maybe they removed them in the new Android Studio version? – mbo Aug 30 '19 at 08:45

1 Answers1

0

I think you did not provide enough information to understand what is the problem here. However, I think, your workspace.xml file is resetting each time you are updating your code from git or some other version controlling system. If you are using a mac, the code styling or other configuration of the IDE is stored in here and each time you load the program, it loads the IDE configuration from the file.

Now there can be several cases here.

  • You are not committing the changes in your workspace.xml file while you are committing and pushing your changes to your remote git repository.
  • You might have added the workspace.xml file in git/remote repository before and then have added the file in your .gitignore file later. Hence, the newly modified workspace.xml is not being tracked anymore and the changes are not submitted in the remote repository. And then each time you are pulling the code from the remote repository, you are getting the older version of your workspace.

If this is a problem with a git, I would recommend removing the file from the remote git repository as described here in this answer.

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
  • thanks for your comment. This problem occur not when I pull data from remote repository. It looks like it "floating" or related with commit – Peter Staranchuk Aug 17 '19 at 12:15