Android SDK Compiling Issue? - java

I tried and searched a long time for a solution but I was unable to find it, so I hope you can help me here :)
Here's my problem:
I started creating an Andoid App using the adt-bundle-windows-x86_64-20131030 and had to upgrade to adt-bundle-windows-x86_64-20140321. I now did several changes to the app and I try to run it, but it always shows outdated data. I had some activites and added them to the Manifest and they worked, but then I did some changes including the deletion of these activities. I removed them from the Manifest, I deleted their layouts, deleted all of their classes and took care they are never launched in the other activities.
Now when I try to run the app in the Emulator I'm still seeing the old activities with their menu exactly the same as it was before. One was the old Launcher Activity and got removed, but the emulator still shows the old deleted one.
I already searched all files and did a fulltext search using Sublime covering all files but the snippets I searched for where I'm sure they existed before can't be found.
Do you have a clue why it's compiling old code parts and where this is coming from?
Even if I'm renaming the .apk file in the "bin" folder a new file is created that's exactly the same one.
I hope you can help me :)
Best regards Christian

Related

Module not specified?

I have recently started learning android development, and I just built an app that changes color and text based on pushing buttons and gestures. It ran fine on my phone (Yay!), but then on my second run, an error occurred. When hitting the "run" button, an edit configurations window opened up:
I also noticed, that on the side where my project tree should be is this instead:
I don't think there is an issue in the code because it was running fine before, but I would be happy to post the code if needed.
Also
I dont know if this was the reason, but i'll include this anyway, I tried changing the name of my project, but it wouldn't work, but I changed it back. I included this in my question because that's literally the only thing I did before this error occured.
Thank you so much for helping out a fellow programmer, I really appreciate it. I have been looking at many other forums (for some hours) about this topic, but still couldn't trouble shoot this problem. It seems kind of odd that it was working first, and then it just randomly stopped working. I cant wait for your response!
Here is the dropdown for Module:
As you can see, that is the only option.
Are you sure you are opening the project as android gradle project ?
Try to import the program not open it

Running my new code runs my old code?

Somehow, whatever code I add to my program it does not run on my android device. It just runs my old code.
I am constantly deleting my app from my phone in the App Manager.
If I add new or change functionality the old code still runs.
I even delete complete blocks of code that should obliterate functionality. But somehow all the old functionality remains in the app after reinstall.
Simple example: On a TextButton click i shift some UI element by 200. This works great. When i delete the complete button listener it still works great but i guess completely by itself since the code should be gone.
I tried restarting Eclipse without luck.
This thing is driving me crazy. I was stuck for hours on some simple code and baffled why it did not run. Then I discovered my logs where not showing in logcat. Somehow, sometimes it does update the new code into the device since now i have a log on device resume but i deleted that at least 30 minutes ago and now it is still showing in my logcat.
Desktop app works as it should. I somehow have the feeling this happened before and over time this got worse, up to this point where i cannot test anything anymore.
So to be clear:
I add code to my app.
Run it from eclipse as Android application
No changes show up
Delete app from phone using the phones Application Manager
Delete a complete code block like the show() method that holds my complete stage
Run it from eclipse as Android application
App still runs as it was with the complete stage in tact.
-- edit --
Now I did not do anything to my code for a while and ran it. Now it probably took the code with the version with the empty show() method. However this already has been undone in the present. Could eclipse be stacking runs?
Check
"Project -> Build Automatically"
is checked. (Most likely your problem).
Also doing a
"Project -> Clean..."
tells the IDE to delete any previously compiled binaries and rebuilds them. (The APK file).
This could happen if there is an error in your code and you have selected run without warning when error in program exists. In such a case the last successfully built code would get pushed! As Lestat mentioned try doing a clean, if the project now shows up errors you have your culprit, else make sure your XML files are all proper.
Another check could be to see the timestamp of the last generated apk file in your workspace.
PS: There is a bug in eclipse where it doesnt save a file at time, a simple workspace restart fixes this.
Had the same issue - updated my code and yet the phone was running the old.
Tried Build --> Clean Project
Tried File --> Invalidate Caches/Restart
Now it works and recognizes the new code!
That said curious what #1 and #2 did behind the scenes??

Eclipse .XML files not showing ANY text

The past couple of days I've been having problems with Eclipse, such as appcompact_v7 making a new compact after each problem. Then App_compact wouldn't transfer the .jar files over automatically. NOW I'm having another problem, which is everytime I start a new Android Application Project the textView that says "Hello World!" is "invisible". It says it's on the layout, but it's not visible. Next problem i'm having is that anytime I add a button, TextView, or anything that has text, it's not visible, no matter what color I use with the text. 1. What is causing eclipse to do this? 2. What can I do to resolve these problems?
We're working on a final project for the class and this determines whether or not i pass the class, so i'm FREAKING out. Here is what my project looks like and what its showing :
Please change the theme on top it AppTheme by default. Try using any Holo.Light themes and see if it makes any difference.
I had this problem on last week.
Solution: update your Android SDK and check updates in Eclipse. If it's not work try backup projects and reinstall Android SDK.
Recommend: check locations of files in Android SDK. Google replace SDK files to another location. If it's true, replace files back.
P.S. I have got very bad English. Write comment if it's work. :)

Recovering Source Code from Unfinished App on Android Phone

For the past month and a half I have been working on a project, an app for Android. Today my computer crashed. Apparently the backup didn't backup the source files for any of my projects though; it only backed up the drawable folders for some reason?
Anyway, I was wondering if there was a way to recover the source code from the app on the phone somehow. I never fully finished the app and created an .apk or anything, but I ran it on my phone several times for debugging purposes, so it is on my phone in a fairly recent state. Is there a way to somehow recover the source code for this? I would hate to have to redo anything, but it seems like I'm probably going to have to end up doing that.
I began the project in Eclipse Indigo but later switched IDEs to IntelliJ IDEA. The files I currently have on my computer are:
An EML file for the project. It appears to be blank.
The drawable folders
And that's it. Any ideas?
You can use dex2Jar to get a jar and then use JD-GUI to examine the code. Since it is decompiling it will not be exact, but close.
dex2jar: http://code.google.com/p/dex2jar/
JD-GUI: http://java.decompiler.free.fr/
You could look into this as an option:
It is a tool for reverse engineering 3rd party, closed, binary Android
apps. It can decode resources to nearly original form and rebuild them
after making some modifications; it makes possible to debug smali code
step by step. Also it makes working with app easier because of
project-like files structure and automation of some repetitive tasks
like building apk, etc.
http://code.google.com/p/android-apktool/
You can try file recovery softwares to get back your deleted files from your hard disk(if it is working).
These softwares worked for me in recovering pictures from a formatted SDCARD. So you can give it a try.
You may be able to use IntelliJ IDEA's "local history" feature. IntelliJ keeps track of all your edits in .IntelliJIdea10 folder in the use home. If that folder has not been damaged in the crash you should be able to recover all your codes.
Just right click on the module directory in the Project tab and select Local History > Show History. Wait for the list of history items to load, it may take a couple of seconds. Right click on an item in the left panel and select Revert.

How can I run an app's source code that I got from the Android source code?

For all of you android devs out there that have the Android simulator running on your comp, you know that there are a few built in apps that are already installed on your 'phone'. I had an idea for an app that would utilize a function that is already being done in the spare parts app that comes already installed.
I went on to the android developer site, dug through the source code files, and found the spare parts app, and am now trying to set it up so that running it from eclipse on my machine actually runs the app in the simulator. In other words, I want to be able to make changes to and adjust some of the things in that app for my own needs. But it won't compile, because of a number of different errors.
How do I get that source code running on my local machine? Is there some special trick that I just dont know about? I thought that if I could get the source code than the rest would be easy, but it isn't being too easy.
Not knowing what the error is, it is hard to say. But there are some tricks. First, you want the entire spare parts app in Eclipse, not just the code you are interested in running. Second, right click on your project, and go down to the "Android Tools" menu. Then click on "Fix Project Properties". Do a clean on your project and hopefully that will help.

Categories

Resources