• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Anyone use Eclipse? Need some help :/

SilverDroid

Well-Known Member
Jun 10, 2011
191
69
Hoping someone can help me as Im going out of my mind....

Been following an Android development tutorial guide (video) and had a couple of problems with Eclipse :(

First time round I got to lesson 15 when eclipse decided to go mental and somehow give me loads of errors where none existed before. I went to press CTRL+SHIFT+F and must have slipped. Dont know what I pressed, but I had to start ALL over again :(

2nd time round a similar thing happened... Soooo annoying.

3rd time round, got to lesson 25 :D and now I continuously get the message "Unfortunately ****** has stopped"

There are no errors no though... So not sure what to check and how to proceed. Fair to say I dont want to start all over again and would rather know how to find and fix these types of problems.

Would appreciate some help :)

Silver
 
Hoping someone can help me as Im going out of my mind....

Been following an Android development tutorial guide (video) and had a couple of problems with Eclipse :(

First time round I got to lesson 15 when eclipse decided to go mental and somehow give me loads of errors where none existed before. I went to press CTRL+SHIFT+F and must have slipped. Dont know what I pressed, but I had to start ALL over again :(

2nd time round a similar thing happened... Soooo annoying.

3rd time round, got to lesson 25 :D and now I continuously get the message "Unfortunately ****** has stopped"

There are no errors no though... So not sure what to check and how to proceed. Fair to say I dont want to start all over again and would rather know how to find and fix these types of problems.

Would appreciate some help :)

Silver

Hey Silver!

First, a little programmer tip/rant:
First and foremost for all future programming for all programming codes, you will do very well to backup your projects as you reach each critical point. It is very possible to goof up the project and spend an hour trying to fix the issue, only to realize your "fixing" screwed it up permanently and you have to start over. I just keep my project folder open and whenever I reach a point where I've made several critical changes (ie added a new class or xml), I save my project and then back it up (copy & paste works fine for me). That way if you ever screw up you can just copy any new classes/xml documents you've just created to an external folder, delete the project and import a backup that worked, without losing any hard work! This is implied, but I'll say it anyway, this also counts for when you've finished version 1.0 of your app! Many semi-successful programmers meet a quick end when they release a good 1.0 version, and then save over/delete their stuff as they move to 1.1, 2.0, etc... Once you have a good, working version, back it up and move it to its own folder (ie "MyNew1337App_v1.0_backup") and keep it forever! Then get a warrantied server with a RAID and back it up again! Yay for redundancy! (That last bit's a joke, but not unwise for a critical/profitable app.)

Now, some troubleshooting steps I've learned:
  1. If you use an emulator, be prepared for some problems! If you are working with limited hard-drive space and your emulator keeps crashing you will need to make sure that you are emptying the temp files it creates for the virtual SD Card it uses (Default Location: %USERPROFILE%\AppData\Local\Temp\AndroidEmulator) because it will keep creating a new partition of space, and if you have setup your emulator properly, it will take at least 1GB at a time!
  2. If you use an emulator, make sure it is set up properly! It may work the first few times, then start freezing endlessly! There are various tutorials out there on how to set them up correct, and its different for everyone, but Lars Vogel's tutorial Emulator Shortcuts is a great how-to on a dependable setup.
  3. I highly suggest installing ALL Tools and SDK versions from the Android SDK Manager from Eclipse. (Window>SDK Manager)

Three life-savers for when things stop looking right:
  1. Right-click on your root project folder, and select Android Tools>Fix Project Properties. You will not see anything change, but it can fix some problems.
  2. Right-click on your root project folder, and select Android Tools>Add Compatibility Library. This may take some time, but has resolved some scary errors for me before.
  3. Project>Clean. Awesome tool that doesn't make many visible changes, but works very well.

Some tips for dealing with an emulator issue when other steps have failed:
  1. Even though you are working out of Eclipse it still uses the Android ADB's emulator located in "~your android-sdk directory~\platform-tools". (Default: %ProgramFiles%\Android\android-sdk\platform-tools). Which means the adb's console commands still work! Yay!
  2. A good step to take to help with future issues is to build some basic batch (.bat) files to run adb commands without having to go through the console. For linux users, I haven't had the best luck building android apps from linux, but here's a nice tutorial on building shell scripts for bash. For Windows users (XP,Vista, Win7) I have attached four simple batch files in a zip that may help out. Just drop them into the platform-tools folder and they should function just fine. If you don't trust the batch files, no problem, just right-click and edit them in notepad first. You will see that they are harmless.
  3. run-emulator.bat - This batch file starts the emulator service (not the emulator visually)
    kill-emulator.bat - This forces the emulator to stop when it has frozen up or is otherwise not working properly. (Doesn't always work, as shown below.)
    adbrestart.bat - Just stops and starts the emulator with one command. I usually hit this before doing the last tip.
    getversion.bat - Returns the version of ADB you have installed, which can be useful for some advanced troubleshooting and reference lookups. This will have to be ran from the console or it will close right after opening, but if you want you can add the word pause to a new line in the batch file and save it and it will wait for a key-press before it closes.
  4. Close Eclipse and your emulator after trying the other steps. Sometimes this solves the problem.
  5. Last, but not least the good, reliable IT wisdom that has been passed down for generation: Reboot your computer. :D

I hope this has been helpful... I didn't plan on writing that much. I really need to be updating my app with some fancy graphics or something, but such as it is. Please keep in mind if you spot an inaccuracy in this, please let me know. I have only been programming Android apps for a month now, so my experience is thorough, but limited. Please note that if you are a Windows XP, Vista, or 7 user that any file-directories I listed with %SOMETHING% in them can be copied and pasted into a Run/Command Console/Explorer Window to bring up the directory on your computer... assuming you installed your stuff in the default location.

Happy programming, Silver!
-TN Dev
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones