I have an Android project, and I wanted to replace two of the images I use in it with updated ones. So, with Eclipse closed, I replaced the two images with two of the same dimensions. When I re-opened eclipse, it updated one of the images, but the other one is an old version of the image. I can't figure out for the life of me how to get it to see the new one. I have run Project->Clean , and refreshed the project, but it still references that old image for one of them. The old image is definitely nowhere to be found in the project directory.
What am I missing here? Keep in mind I'm not a very experienced Android dev at all.
If you haven't found the solution yet go to menu project->clean... That should be enough.
Cheers!
Related
As you might know, Remove Unused Resourceshas added recently to Android Studio, Android Studio 2.0 Preview 5.
I run this function by right click on the name of project then Refactor/Remove Unused Resources. It shows a dialog and nothing happens when I click Refactor or Preview buttons. I believe there must be a lot of problems since this is a very big project but I don't see result. Are you able to see any result?
Okay, I just found what is the problem.
The problem was, as I mentioned I was right clicking on project name and did refactoring from there. So this way doesn't work (Android Studio guys must disable this functionality to not staffing people around)
So, By running Analyze/inspect code I could see a list of unused resources. I doubled clicked on an String item then String.xml opened and by doing refactoring/remove unused resources... all resources removed :+1
So it was the trick. I could see all changed files on git. Hope it helps you guys.
i recently started the android tutorial from android.com, after downloading and installing Android Studio and the sdk. I made the first app and all, working directory is on a Flashdrive, Android Studio and sdk are on the HDD.
I'm currently stuck at the "Adding action bar buttons" tutorial, as android studio doesnt find "#drawable/ic_action_search".
I understand that it should be in the MyfirstApp/app/src/res/drawable- folders, but those are practically empty (see picture below).
I did find an answer on here that states to simply copy the required drawables from sdk/platforms/android-/data/res/drawables-.
Another one states, I can adress "standard" pictures (like the search action icon in my case) by using "#android:drawable/ic_action_search", but that doesnt work at all.
Is there a good workaround, easier then putting every icon in every corresponding folder, every time i need one? The tutorial doesnt have that, it seems the guy writing the tutorial relied on the icons just being there?
(May solve itself with 1.)
In that other folder, there are many, many drawables, but the one folder I searched (drawable-hdpi) doesnt even have an icon called ic_action_search.png so...where do I usually get that?
Thanks for helping, I'm still hoping this is a common mistake so there's an easy solution here^^
Edit: manually starting the gradle build task doesn't work either, same problem.
()
Does your project build? Try running the gradle build task manually.
screenshot
I had several layouts for various size devices and at each orientation. Somehow, they've all disappeared and only the original layout shows again, no matter which device type or size or orientation I select in Android Studio's renderer.
I've upgraded Android Studio. I've renamed the parent folder the source project and files were in. I've upgraded the sdk. Also, Although my app is not a Gradle project, I did something the IDE kept bugging me to do... I believe I moved something from AndroidManifest to build.gradle.
I don't know which step caused me to lose my layouts, as I didn't notice as I worked on other things.
Does anyone have any idea what I might have done that would cause my layouts to disappear?
Thanks.
They have not disappeared and you have not lost them!
Click on the drop down which I have circled (It probably says Android for you) and choose "Project" view which is what you were used to before the update.
OK, I have been wanting to try the new ActionBarCompat, however, I am not able to run my programs in the emulator.
I have been trying to implement the following: http://antonioleiva.com/actionbarcompat-how-to-use.
and have been stuck on basically the first part. However, working with the author of that content, I was able to get further as I was not adding the project under sdk\extras\android\support\v7\appcompat folder like stated. However, I still think that might be the reason I cannot do this...
More detail can be found here: http://antonioleiva.com/actionbarcompat-how-to-use/#comment-43
Basically, on my first attempt, I just created an Android project, and changed the source code as indicated. Code would not run on the emulator. So I went back to the original code, and that ran on the emulator.
Checked online, found out I might need to add the \extras\android\support\v7\appcompat folder as a library to the project I am building. So I added that and a new android project was created. There were build errors from the start, but I failed at trying to add it as a library to my project, and deleted it....thinking this was way overboard.
After back and forth chats with author of linked website, I found out I had to do that overboard thing.
So I tried the following link to the T: (I cannot post more than 2 links due to low repuation...I will add this link as a comment below)
However, Eclipse would not allow me to add the appcompat Existing Android Project...but it did allow me to add the appcompat Existing (General) Project. I think this may be some of the problems??
Right now, I cannot run the project at all. Eclipse is showing a red exclamation mark on the project folder, but all the code seems to be fine. So I don't know what to do now...I recreated this project several times over, and this one was the one where I knew what to do...and I am still getting problems
So...
I decided to move to Android Studio...updated the IDE, updated the SDK manager to include the new support library, and other things. Created a new project, added to the build.gradle file as shown in the link provided below in the comment. I ran the ant build, and then built the project...tried to import the right things to allow ActionBarActivity, but I could not get that far.
I can import
"android.support.v7.*"
"android.support.vy.R" // and all folders within
but nothing allows me to add ActionBarActivity, and I don't know why.
FYI, I guess I would prefer a solution to Ecplise, as it seems like I actually got somewhere with it.
The best example to use is from here, and I would follow it closely. I had similiar issues when I first came across this. Problem was I misunderstood what I needed to do
http://developer.android.com/tools/support-library/setup.html#libs-with-res
I have a minor issue with the way IntelliJ caches files or builds (not sure about terminology here).
Situation Abstract:
Library module
DrawableA
DrawableB
App module
DrawableA
Assume library images are black and white, App ones are color.
The app shows (correctly) the colorful A.
The app shows (correctly) the black and white B (means its missing).
Now I add an image to App project, Drawable B, in color.
If you simply press "run" he will keep using black and white B
If you "rebuild project" he will use the correct one
If you try "Make" and "Compile" manually on Lib and App NO EFFECT
To clarify, this issue is really special. It only occurs if the DrawableB is NOT present in the App module. If you have it, but the WRONG one, and you update it, it works. I assume its an internal caching of IntelliJ, and he does not recognize that I added a drawable (and he has to use it from the App now, not the LIB). Perhaps its something in the google build of Android projects, not enough info about the internal here...
I know, the obvious tip is "do a rebuild of the whole project" - that said, I have 18 App modules, each for one App. The rebuild takes forever (on one of our machines without SSD), and its not neccessary. If I change something in e.g. AppX, I only need to rebuild AppX and the Library. But there seems to be no option for it.
Does anyone know a workaround, like deleting BIN or other cache folders via script? Cant split up the modules in different "projects", would loose refactoring capabilities.
Crosspost here, check before wasting time to answer (this site here is more frequented and faster, but this issue is so specific, cant hurt to ask the developers too)
http://devnet.jetbrains.net/message/5446674
Try to rebuild project. Smtm i have same problem and it helps me.
Can you try it with the new IntelliJ Idea version 12? It seems to handle cached resources pretty well.