3

While I was working with my android project I wanted to edit one of my xml files. So I just opened it and this is what I saw:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CMakeSettings">
    <configurations>
      <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
    </configurations>
  </component>
  <component name="PropertiesComponent">
    <property name="android.sdk.path" value="$USER_HOME$/AppData/Local/Android/Sdk" />
    <property name="settings.editor.selected.configurable" value="preferences.updates" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <envs />
      <patterns />
      <method />
    </configuration>
    <configuration default="true" type="Remote" factoryName="Remote">
      <option name="USE_SOCKET_TRANSPORT" value="true" />
      <option name="SERVER_MODE" value="false" />
      <option name="SHMEM_ADDRESS" value="javadebug" />
      <option name="HOST" value="localhost" />
      <option name="PORT" value="5005" />
      <method />
    </configuration>
    <configuration default="true" type="TestNG" factoryName="TestNG">
      <extension name="coverage" enabled="false" merge="false" sample_coverag

Then I found out another xml file that looks like this:

import android.os.AsyncTask;

import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.sheets.v4.model.BatchGetValuesResponse;
import com.google.api.services.sheets.v4.model.ValueRange;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class SheetsApiManager extends AsyncTask<Void, Void, List<List<String>>> {

    private com.google.api.services.sheets.v4.Sheets mService = null;
    private HttpTransport transport = AndroidHttp.newCompatibl

And this content is a cut Java class from another project that was opened in the same time. When I try to open this files in Notepad++ I can see the right code.

What I did so far was Clean Project, Rebuild Project, Invalidate Caches and Restart, Android Studio Restart, System restart and I deleted Build folder and rebuild project again. It still didn't bring any changes. I also thought about reinstalling Android Studio but I'd like to make it work again without this idea. Also running my app is not making any errors and it works fine.

Anyone had the same or similar issue?

Mieczkoni
  • 505
  • 2
  • 8

1 Answers1

1

This happened even for the Android Studio v3.2.1 (latest stable version).

The only solution I have found was reinstalling the Android Studio without importing the old configuration.

Changing the File Encoding in settings to UTF-8 or System Default didn't help either.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • Well, I did reinstall Android Studio but it didn't change anything. Is the old configuration importing automatically? Maybe I'm doing something wrong, how to avoid importing the old configuration? – Mieczkoni Oct 15 '18 at 22:58
  • 1
    Go to `C:/Users// ` Delete the `.AndroidStudio` directory. The when you're reintsalling the app, make sure you don't check the using of old config. I guess it's somehow used the old config, that's why it happened and nothing's changed. – ʍѳђઽ૯ท Oct 16 '18 at 07:07
  • Thanks, I had to uninstall Android Studio, delete all .AndroidStudioX.X folders and install Studio again. Then I could choose to not import old configuration. Now it works again. – Mieczkoni Oct 16 '18 at 14:12
  • 2
    For anyone else who came to this SO entry with this problem, there is a solution which does not require reinstalling, located here: https://stackoverflow.com/a/54509482/530047 where you manually delete the C:\Users\my_user_name\.AndroidStudio_YOUR_VERSION_HERE\system\caches folder. – Jon Sep 21 '20 at 14:21