问题
Before you downvote my question because you don't see any code (ridiculous reason to downvote), read it.
The Problem
The problem is that even when I change my code and run it on my phone, it will run but the app won't have actually changed.
For example: if I used to have Toast that would say "hello world"
in onCreate, but then I changed the text to "should be updated"
and then ran it, the toast would still say "hello world"
.
What caused the problem
I updated my SDK Tools and then updated Eclipse. I updated all of my Android SDK tools that said needed an update in the SDK manager. Then, I did this to update eclipse: Help --> Install New Software...
then I clicked Add...
, then entered 'ADT plugin' for the Name and https://dl-ssl.google.com/android/eclipse/
for the Location. Then I updated and restarted Eclipse or whatever.
Here is the screenshot of my workspace loading:
What I've tried
- Deleting the app on my phone and then running it
- Deleting the app on my phone, changing the package name of the app and then running it (although I didn't get to see if this would've worked because Eclipse is so bad that it didn't let me even run the app on my phone). I've changed the package name before and I know how to do it. Eclipse sucks, not me.
- Cleaning the project (it didn't generate my R.java file, so I didn't get to see if this would've worked)
I've read this and it doesn't help: Why is my updated Eclipse / Android setup not building my APK anymore?
What I could try
I could try reinstalling Eclipse from scratch, but then I'm worried that something stupid will happen with my app signatures and for some reason I won't be able to use my old projects just as they were. I'm also running eclipse through one of my old Titanium downloads. I don't use Titanium, but originally my Eclipse was downloading in a Titanium package. That might have some effect on how easy it would be to recover my old projects and get them working.
It really just seems like this Eclipse is super buggy. I don't know what version I had beforehand, but it wasn't very old. Right now I'm not even sure what version I have. I thought I was getting 22.0 or something, but the screenshot shows 21.0.1-543035.
回答1:
Go into the SDK Manager and install the Android SDK Build-Tools in the Tools folder.
This is new to SDK revision 22. In the update text for rev 22 is this:
• Changed the structure of the SDK by adding a new build tool SDK Component, which is based on the existing platform-tools component. This change decouples the build tools versions from the IDE versions, allowing updates to the tools without requiring an IDE update.
Because of this update, the tool to build APK's was not included in your SDK update, since it is now a standalone item. As such, your APK would not have been updated, but would still install since it had an existing APK already built.
来源:https://stackoverflow.com/questions/20434489/why-is-my-code-not-updating-on-my-app-after-updated-eclipse