I have a project which is connected to SVN server. I use Subclipse as the SVN Client.
I have some problem which I don't know what's the cause. the problem is,when i delete some images from res/drawable folder my program's images become so broken. lets say for example
the splash screen image changed with some button image
the button image changed with background image
etc,, everything is changed.
The problem will be gone if I revert back the change (restore the deleted images). That will be some trouble if I can't delete any unused resources at all. I don't have any idea about this problem. does anybody ever have the same problem?
note : I deleted the images when my connection is off. is that
You should commit deleting changes
Try to rebuild R class.
Related
I was coding my android program on Android Studio and I made quite a progress on it. I remember I copied all the codes in my colors.xml (ctrl+A) when this happened. I was thinking to change the background image of my app so I deleted my background image in my drawable folder unchecking the "safe delete" option.
When the background image was deleted, I put another image using batch drawable import hoping that it would exchange the background image of my app, but it didn't. I tried to change the background image by linking the image in my code in the layout folder, same results. So I thought I could invalidate caches and restart hoping to fix the problem.
To my surprise my whole project was a mess, the errors where from my build gradle, all of the codes were changed! It was replaced by the codes used in the colors.xml
Now I can't do anything, I think I'm going to redo the whole project now but it'll take quite the time. So I'm asking here why it happened, or is there any possible solution as to I could recover my project codes? Thanks!
is there any possible solution as to I could recover my project codes?
Yes. You have few options to recover your project. One option is revert your project code which I normally do.
Right click app ---> Local History ---> Show History
Then you can select which file or time you want to revert.
A very common thing that I tend to do is when I need to update a graphic or something in the drawable-nodpi folder, or any other folder for that matter, Android Studio doesn't detect the change so of course when I try to "PUSH" to GitHub it doesn't actually push and just tosses me the "No Changes Detected" message.
Is there a way to push anyways? Just to force a commit on specific files that I want to push because I know for a FACT there was a change and I need it submitted?
Lately I been having to delete it first from within Android Studio, then save the file, then add it to GIT then try a commit, but even this works only 70% of the time and is very annoying.
Perfect Example.... I have a splashimage.png in the drawable folder, I am in Photoshop and I change something then do an override to the splashimage.png with my change, but of course Android Studio doesn't see this as a change so I can't Commit this file to Git or anything.
Are you using external editors like photoshop when editing files? If so, press refresh in Android Studio to make it detect changes in file system. Then it says something has changed and suggest you to commit. Of course you can use command line to add changes anyway and commit without even using Android Studio.
Apparently the item I was looking for was the Synchronize. I just go to the file and Right Click > Synchronize and it then does a check against the last one manually and see's if it was different. Kind of a Refresh like Kuitsi had stated, but its called Synchronize. Also some reason I can't get it to work by just clicking Synchronize next to the SAVE icon at the top under File menu. Not sure why.
Whats your git status after you copy the file? Do you commit the changes, before pushing?
Have the same problem. Resolved.
The multi-root project used to work just fine for years, detecting changes in sub gits, properly pushing/pulling per sub, but not anymore. After some playing with a broken merge, it has stopped working. And that's not a local git repo issue. Cloned it from scratch - same issue. Changes (doesn't matter internal or external) are not detected by the Studio VCS facility, though git from console shows changes, View/Recent Changes shows them, Local Changes tab doesn't show any (single Default changelist).
It looks like something has happened with the VCS roots detection or related settings. Fixed with Preferences/version Control adding missing roots manually. I wish there is an option to rescan a folder or to delete some settings file and have the studio detecting these roots again.
After a month of development, my project has suddenly decide to refuse to update my button graphic. I took my existing 9patch button and brightened it a little, saved it, and now it won't update on my device. Eclipse shows the new graphic (eventually) but the device rendition is the old button. I have to manually Clean, but in doing so my 9patch has broken and doesn't scale. I've read my 9 Patch Image stopped working and included the jar, but still the 9patch I'm trying to change won't update on my device, or it updates as a standard fixed-sized image with the black 9patch markings showing. If I delete the 9patch from resources and replace it with another button, it works.
Basically it's as if my project has gotten hokey. I've used Clean... and resource Refresh repeatedly, but it's not playing well. Once it even said I had manually edited the R.java file after a Clean... Is there some super cleanup reset thing I can do?
tldr; When I change graphic, the new graphic isn't updated on device. I use refresh and Project/Clean but that breaks the 9patch. What's wrong?
I found a very strange and anoying bug.
Im developing in Eclipse, i use several images for my app.
Sometimes when i import a new image to the project and use it somewhere in my app, after the test run all the images are went to another places... Its like every image has changed their resource ID and they are all moved to another places... background loads for buttons, button image loads for scrollbars.. etc... every image is bugged and appear in random places!
Nothing can solve this bug, except deleting my app manually, then run again.
I work on my phone, not Emulator.
It is really annoying, i dont want in the future that when im updating in market, the users will get a messed up app...
Anybody know something about this?
That's probably because the R.java is messed up.. try to do Project->Clean and see if that solves the problem
If you are importing any image make sure that the name of the images in not in Capital letter and also its name doesn't start with any numeric value. Otherwise its going to create problem in generating its id in R.java.
When I add drawable resources to my project they do not show up in the list of drawables in the Reference Chooser. I checked the R file and there are references for the files.
I have tried refreshing the project, cleaning the project, and fixing project properties and nothing seems to help. Sometimes a couple will randomly show up in there, but not all of them.
The only consistent way I can get them to show up is to restart Eclipse.
Any ideas?
Thanks
Edit: Further findings:
After some trials, I found an other inconvenient work around to he issue. Turns out when importing multiple files into the project at once, Eclipse will only add the last one imported into the reference chooser. So when I imported my images one at a time, they all show up properly!
Like I said, inconvenient considering the amount of images I have left to import, but maybe with this new information it may help nail down where the issue may be and a possible fix.
I too faced the same problem. I added an image to the res/drawable-hdpi folder, cleaned the project and was able to see the name of the image in the left pane in Eclipse. But when I tried to use this image using Reference Chooser and looked under Drawable, I didn't find it.
I simply exited from Eclipse, and started it again. It was there! Like many things in computers, problems can be resolved simply by restarting!
The only way I found to fix this is to include the generated R class itself.
I found out some new info again.
Since I am doing a port from Blackberry, almost all of my images' filenames have uppercase letters in them, so I end up importing them all and then having to rename all the images after they are imported into the project.
I tried renaming all of my images before importing them all into the project. To my delight, all of the images showed up right away in the reference chooser! So it seems there is a problem when you import files and they cause errors with your project and allowing all of them to show up in the reference chooser.
So if you have to rename files, do it before import!
I'm just not entirely sure that this is the only cause for this issue but it has solved the problem for me.