Android Studio is showing wrong project name - android-studio

I have an Android Studio Project , the original name was GUI-refresh-by-time however it is showing Typer in the main screen.
But when I open the project, it becomes GUI-refresh-by-time
My .idea/.name is called "GUI-refresh-by-time"
How can I resolve this issue? It might lead confusion specially when you have too many projects.

Ok, I solve it anyway.
The problem occurs because I have another Android Studio project name
Typer , both of them are located in the same Folder Location root/Gui-GUI-refresh-by-time and root/Typer
Basically this root/Typer does not have .idea/.name so I decided to delete the Typer project Folder and reopen my Android Studio, after then it works.

you could just remove the project from the workplace by saving it elsewhere and try reimporting it

Related

Android studio messed up every xml file. How to resolve it? [duplicate]

I have an odd problem with Android Studio.
Here is how my class file looks like on Android Studio
And here is what it looks like on a text editor.
Any ideas why it is happening? I have tried closing then reimporting the project, invalidate caches and restart, clean project, build project, delete .idea folder and .iml files. All of my files are broken when opening in AS but looks fine on text editors.
UPDATE: Quicker solution by the user Hong given below:
Delete the caches folder: C:\Users\my_user_name\.AndroidStudio3.3\system\caches
=====================
Here's what worked for me.
Close Android Studio
Go to C:\Users*your username*
Locate the Android Studio settings directory named .AndroidStudioX.X (X.X being the version)
Rename it to something like old.AndroidStudioX.X
Start Android Studio, and when it asks if you want to import settings, choose the old directory
This should fix the issue.
Thanks to the Answer of Asim, I found deleting folder caches fixed the problem for my case (all gradle files in Android Studio show contents that have nothing to do with the actual contents of these files):
C:\Users\my_user_name\.AndroidStudio3.3\system\caches
Edit[2020-07-17]:
This is still happening with Android Studio 4.0, so I have to delete the following folder to fix this problem:
C:\Users\my_user_name\.AndroidStudio4.0\system\caches
Edit[2021-11-08]:
This solution no longer works for Android Studio Arctic Fox. Please see the new answer by Nikunj Paradva. I have used the new solution and it works.
Solution for Android studio Arctic Fox and Higher Versions
Steps
Exit Android Studio
Delete caches folder from
C:\Users\{username}\AppData\Local\Google\AndroidStudio2020.3 // For Arctic Fox
Open Android Studio and your code has being Perfect
Check your Android studio version and Target that version folder at below location
C:\Users\{username}\AppData\Local\Google
Note : AppData folder is Hidden in Windows
Does this situation warrant a bug report?
Yes! In fact this problem has been reported to the Android Studio team, and anyone willing to help us investigate is welcome to contribute there. Thanks!
You can also try the workaround in Hong's answer.
Close Android studio and then delete the caches folder: C:\Users\user_name\.AndroidStudio3.4\system\caches
Try to delete the Android Studio IDE cache data listed below per your platform:
Windows:
%USER%\.AndroidStudio[Preview]_X.Y_
Mac:
~/Library/Preferences/AndroidStudio[Preview]_X.Y_
~/Library/Caches/AndroidStudio[Preview]_X.Y_
~/Library/Logs/AndroidStudio[Preview]_X.Y_
~/Library/Application Support/AndroidStudio[Preview]_X.Y_
Linux:
~/.AndroidStudio[Preview]_X.Y_
See: https://developer.android.com/studio/releases#delete-unused
Updated my android studio days ago and was faced with the same problem. Solved it by uninstalling android studio and reinstalling the previous version set up I had left the SDK intact so I didn't have to re-download them working perfectly guess I won't be updating again soon.
Thanks to #Henry for confirming, by several similarly observed whacko problems the past two days, that my problem is indeed caused by a bug in AS. Follow his links to become convinced yourself. I'll let Henry file the bug report.
So there's no fixing my problem in situ without great effort--wait for bug fix.... which could take awhile.
So here's what I did to work around it and get back to work (it took less than 10 minutes):
create new project with no activity
(Do the rest inside the IDE, not using Windows or DOS.)
copy all .java files into the java folder in the IDE (it's ...\app\src\main\java\)
copy all res folders into the res folder (...\app\src\main\res\)
copy all asset files into main folder (...\app\src\main\assets\)
copy androidmanifest.xml into main folder (...\app\src\main)
do a global replace of old project name to new project name
I didn't change any of the files in the new project's ...\app\ folder because compilation was normal.
(I'll tell you this: when I saw what I THOUGHT were mangled FILES and looked at the History and saw nothing resembling what should have been there, I got a sick feeling, but I immediately opened Windows Explorer, selected all of the project's java files, and opened them, en masse, with Notepad++. Whew. No problems seen. (I didn't really think AS could actually mangle the files and I doubt it ever could. But it did wake me up at 5am!))
copy your android project to another location then open it from android studio
I changed my projects location and it solved my problem. This happened when my system was accidently shut down due to power failure.

Android Studio broken .studio instead of classes shows incomprehensible pieces – xml

I started the studio and see such a picture, considering that all the classes are broken and everything is lit in red - the project is going and working. Help me fix it. Invalidate does not help. Instead of classes in general pieces of markup ...
Close Project
Try Removing .idea folder from your project.
Restart your project again in android studio
I have delete caches folder from C: Drive. after open project in an Android studio.
C:\Users\admin.AndroidStudio3.3\system\caches
link here

Android Studio shows wrong file contents

I have an odd problem with Android Studio.
Here is how my class file looks like on Android Studio
And here is what it looks like on a text editor.
Any ideas why it is happening? I have tried closing then reimporting the project, invalidate caches and restart, clean project, build project, delete .idea folder and .iml files. All of my files are broken when opening in AS but looks fine on text editors.
UPDATE: Quicker solution by the user Hong given below:
Delete the caches folder: C:\Users\my_user_name\.AndroidStudio3.3\system\caches
=====================
Here's what worked for me.
Close Android Studio
Go to C:\Users*your username*
Locate the Android Studio settings directory named .AndroidStudioX.X (X.X being the version)
Rename it to something like old.AndroidStudioX.X
Start Android Studio, and when it asks if you want to import settings, choose the old directory
This should fix the issue.
Thanks to the Answer of Asim, I found deleting folder caches fixed the problem for my case (all gradle files in Android Studio show contents that have nothing to do with the actual contents of these files):
C:\Users\my_user_name\.AndroidStudio3.3\system\caches
Edit[2020-07-17]:
This is still happening with Android Studio 4.0, so I have to delete the following folder to fix this problem:
C:\Users\my_user_name\.AndroidStudio4.0\system\caches
Edit[2021-11-08]:
This solution no longer works for Android Studio Arctic Fox. Please see the new answer by Nikunj Paradva. I have used the new solution and it works.
Solution for Android studio Arctic Fox and Higher Versions
Steps
Exit Android Studio
Delete caches folder from
C:\Users\{username}\AppData\Local\Google\AndroidStudio2020.3 // For Arctic Fox
Open Android Studio and your code has being Perfect
Check your Android studio version and Target that version folder at below location
C:\Users\{username}\AppData\Local\Google
Note : AppData folder is Hidden in Windows
Does this situation warrant a bug report?
Yes! In fact this problem has been reported to the Android Studio team, and anyone willing to help us investigate is welcome to contribute there. Thanks!
You can also try the workaround in Hong's answer.
Close Android studio and then delete the caches folder: C:\Users\user_name\.AndroidStudio3.4\system\caches
Try to delete the Android Studio IDE cache data listed below per your platform:
Windows:
%USER%\.AndroidStudio[Preview]_X.Y_
Mac:
~/Library/Preferences/AndroidStudio[Preview]_X.Y_
~/Library/Caches/AndroidStudio[Preview]_X.Y_
~/Library/Logs/AndroidStudio[Preview]_X.Y_
~/Library/Application Support/AndroidStudio[Preview]_X.Y_
Linux:
~/.AndroidStudio[Preview]_X.Y_
See: https://developer.android.com/studio/releases#delete-unused
Updated my android studio days ago and was faced with the same problem. Solved it by uninstalling android studio and reinstalling the previous version set up I had left the SDK intact so I didn't have to re-download them working perfectly guess I won't be updating again soon.
Thanks to #Henry for confirming, by several similarly observed whacko problems the past two days, that my problem is indeed caused by a bug in AS. Follow his links to become convinced yourself. I'll let Henry file the bug report.
So there's no fixing my problem in situ without great effort--wait for bug fix.... which could take awhile.
So here's what I did to work around it and get back to work (it took less than 10 minutes):
create new project with no activity
(Do the rest inside the IDE, not using Windows or DOS.)
copy all .java files into the java folder in the IDE (it's ...\app\src\main\java\)
copy all res folders into the res folder (...\app\src\main\res\)
copy all asset files into main folder (...\app\src\main\assets\)
copy androidmanifest.xml into main folder (...\app\src\main)
do a global replace of old project name to new project name
I didn't change any of the files in the new project's ...\app\ folder because compilation was normal.
(I'll tell you this: when I saw what I THOUGHT were mangled FILES and looked at the History and saw nothing resembling what should have been there, I got a sick feeling, but I immediately opened Windows Explorer, selected all of the project's java files, and opened them, en masse, with Notepad++. Whew. No problems seen. (I didn't really think AS could actually mangle the files and I doubt it ever could. But it did wake me up at 5am!))
copy your android project to another location then open it from android studio
I changed my projects location and it solved my problem. This happened when my system was accidently shut down due to power failure.

Error after updating Android Studio

I have updated my Android Studio to 1.2.1.1 and now i am trying to create a new project and it shows an error:
"Error Loading Default Project "
Fatal error initializing 'com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager'
Please suggest a solution. Thanks in advance
Experienced the same problem on Ubuntu/Linux.
In my case the solution was to change the save path of my project from relative, to absolute.
Trying to create a new project in ~/AndroidStudioProjects/MyApp would generate this error
But if I specified the full path /home/myusername/AndroidStudioProjects/MyApp, the problem was resolved.
You have to reset Android Studio and this is a configuration problem.
Uninstall android studio and install again.
This link will help you with all steps of reinstall.
Unable to create new android studio project?
I just came across the same error:
'com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager'
Make sure that you have permissions to write to the project path.
android studio stores the project in the last location you loaded from and in my case it was a Flash Drive...
#Garima Mathur's answer suggests that is a 'configuration problem'
If it's a 'configuration problem' you can delete(*or better rename) the configuration folder.
which is located in the c:\users\CURRENT_USER\.AndroidStudio1.2
but in my case the solution was to change the path of the project to be saved.
I had the same error of "Error Loading Default Project"
Fatal error initializing
'com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager'
and I figured out where the error was coming from. Previous I was running my project from a USB key labeled volume F. Later when I opened Android studio after unplugging, the default storage path was still F. Make sure your path is okay.
I also had the same problem. Following process worked fine for me:
Open your any old project in android studio.
Go to File > New > New Project.
Set Name to your Application.
At bottom of window there is "Project Location TextField".
Just change the Location Path to the desired folder and click Next Button.
I had the same issues, I tried to figure it by my self and it worked.
Try this, open your old project, then in your old project window, go to file > new > new project, and it will show the new project window to let you setup your project, after you finish your project setup, click finish and your project will start building and it will bring you to your new project window.
That's all, it works for me.

Project Name in Android Studio Does Not Change

I followed the instructions here Change project name on Android Studio and while my project name in the project explorer changed, the project name in the top IDE bar does not(the very top left of the IDE window). I renamed the project by right clicking the project name, updated the manifest's app_name and package name.
This is a bug where some pointers in the duplicate project still point to the original project. I experience this only when using "Open Project" to bring the duplicate up in AS. This is solved by using the "Import Project" instead and then refactoring and renaming accordingly.
This brings up another issue, however. While the naming is correct, something is still pointing to the original, because launching either the original or the duplicate on the device replaces the other on the home screen.
With Android Studio off, I renamed the project folder in Explorer and restarted Android Studio and imported project. Now this created another .iml in the project folder so I went ahead and deleted the old .iml .
(it seems to have correctly changed the app.iml in src also)
I hope this is all there is to it.
this work for me:
Close android studio
Change project root directory name
Open android studio
Open the project(not from local history but by browsing to it)

Resources