Android Studio Local History Revert Not Working - android

I am trying to revert my 'res' folder to a previous version which is stored in local history. When I open the local history viewer and select revert on the version I want, the differences inside the history viewer go away and I am left with a screen that says "No differences". However, when I close the window and look at my project, nothing has changed. The revert seems to not go through.
I have already tried reloading the project to no avail. If I reopen local history viewer it continues to display the "No differences" message when I select the version I am trying to revert to. Any ideas on how to fix this?

Related

I accidently deleted an activity.java from my com.packagename.appname. How do I get it back?

While adding a feature to my app I messed up and decided to delete all the new files I had added for it but in doing that I accidentally deleted one of the activity from my app. I have integrated version control in my app and also shared my whole app source with GitHub but for some reason whenever I check out of previous version controls I cannot find the file. How can I recover the activity.java file? I have the app installed on my phone. Is it possible to recover it from there? or any other way to recover it?
If Ctrl + z or version control didnt worked try to check the local history of the android studio:
Move to project structure -> right click on your app name -> local history -> show history
Click on your package and do Ctrl+z and then undo changes.

Android Studio replacing my xml layout (bug)

I was previously working on a 1 month project using Android Studio. My xml layout was all well and good until I opened it up today and had the following as my xml code:
As you can see the preview is showing the correct data, but the code is not.
What happened, how can I retrieve my original code?
Some of the files were not backed up on a VCS.
You can check the android studio local history if your files were not backed up:
Right click on your app folder - select "Local History" and "show history" to see your latest file that got changed

The Android SDK could not be loaded Processing

When I try to download the Android SDK when Processing doesn't find it, at 30%, it says "The Android SDK could not be loaded, Android mode will be turned off"
I'm using Windows 10 home edition, Processing 3.3.6, Processing-Android 4
https://github.com/processing/processing-android/issues/421
Install Android Studio, open it
click configure, click SDK Manager, checkmark the box labeled Android 8.0 (Oreo), apply, install, copy the file path at the top, apply.
Open processing, in android mode, select Locate SDK Manually, paste.
It is quite simple! Download Android Studio from https://developer.android.com/studio, install it, click the "SDK Manager" button on the top right corner, as you can see in this image. Then download the version of the SDK that you want...make sure to download the correct version - the one mentioned by the error dialog from the PDE (Processing Development Environment/ Processing IDE/program/app). After it has downloaded, select the checkbox next to it, and copy the path for it, as shown here. Launch the PDE in Android mode, and when it asks you for the path, Select Locate SDK Path manually and paste the path there. It should work now.
On Windows, at least, You may want to un-hide the AppData folder, I had to, though I'm sure it's not a requirement, if it has worked out for you so far, skip this step!
To unhide the folder, in the Windows Explorer, go to C:\Users\<Username>\, select the AppData folder, and unhide it..
(Enable "Hidden items" under "View" first! look at this image for reference)
..by going to View > Hide selected items, as shown in this image and selecting "Apply changes to this folder only". THEN the PDE may be able to see it. YOU MAY WANT TO HIDE THE FOLDER AFTER DOING THIS! It is a quite important system folder, though I'm sure many people access a lot, it still needs security; ...it's better for you, I guess.

blank android studio "can't load settings from file workspace.xml"

When i open android studio it shows me blank screen like i don't have any projects with a yellow message at the top corner that says "can't load setting from file workspace.xml..."
After i tried to delete the workspace.xml file as suggested here and open android studio again the message didn't appear but it was still without any projects. Yesterday everything worked fine and i can still see my project data on the windows explorer. Can someone please tell me how to fix this issue.
go to your user folder
[SYSDRIVE]:\Users[your username] (ex. C:\Users\aman)
In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio (notice the period at the start - so on some OSes it would be hidden).
Delete this folder (or better yet, move it to a backup location - so you can return it if something goes wrong).
this will solve your problem.

Copying Android Studio project, making edits to copy, and building to phone uploads the old project to my phone

I am making an app following a book tutorial and at the end of each chapter there are "challenges" to add onto the app and the book suggests making a copy of the project and working on the challenges on the copy so you dont accidentally mess up the original.
I right clicked my project in the project explorer in android studio and went to Refactor ->Copy and typed in a new name. Then i opened the new version with a different name and made changes to the files (including adding a button and new actions when the button is pressed).
But when i run it and select my phone it my phone opens up the old project without the changes.
What is going on? How do i make a copy of a project and make changes so i can upload it to my phone as a new and separate app?

Categories

Resources