133

Every time I try to export an APK from Eclipse (tried Juno and Indigo) on Mac, eclipse crashes after a few seconds

This used to work fine on my current setup.

Running the app straight (debug mode) on my phone works fine.

The error from the console is:

Invalid memory access of location 0x10073f113 rip=0x101f656f7
Bus error: 10

I'm using Mac OS X 10.7.4 on a ~2010 MacBook Pro, with the following java:

java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

I'm using ADT 20.

I've tried reinstalling Eclipse and the Android SDK, and re-downloading ADT.

The Eclipse error view doesn't show anything

Any ideas of different methods I can try, or other ways to investigate what's going wrong?

Cheers

Update: For anyone coming along post-2014, you should be using Android Studio, which doesn't have this problem.

whalabi
  • 1,675
  • 3
  • 12
  • 16

8 Answers8

411

Disable Project/Build Automatically when you are exporting

I think is a problem of Eclipse unable to detect the Android command is still working or something similar.

Of course there is ever the option of APK generation using Ant outside Eclipse you can generate an Ant build.xml from your Eclipse project more info in official Android docs

jmarranz
  • 6,459
  • 2
  • 21
  • 10
  • 1
    I've moved on from this a while ago but given the amount of upvotes your answer has I'll assume it works – whalabi Dec 11 '12 at 02:14
  • 2
    No idea why but this also worked for me on Ubuntu Linux (Dell XPS13 running Project Sputnik distro with latest ADT Bundle). Problem started without any changes or warning, one day it worked the next it didn't. Increase to heap size didn't fix it but as soon as I turned off auto build it was fine. Weird. – BasicPleasureModel Jan 08 '13 at 10:35
  • 35
    Can't believe this is still happening. So essentially the default Android development kit crashes everytime when you try to export an APK. Incredible. – Dave Jan 25 '13 at 12:48
  • This works for me as well but it's too much work to turn on/off build automatically every time. It only crashed recently for me after I updated ADT and Android SDK on Mac. I didn't need to do it for years. – PokerIncome.com Jan 30 '13 at 19:58
  • 3
    I set the build output to Normal as is described here: http://stackoverflow.com/questions/7843436/aapt-exe-crashes-when-i-try-to-export-my-android-application-from-eclipse and then Eclpise didn't crash. ADT 21.1.0 on Eclipse Juno. – sanna Feb 15 '13 at 13:30
  • Life saver! I lost count the number of times Eclipse kept on crashing on my Ubuntu VM. Success rate was 2%.. now 100% :-) Thank u!! – Ernest Feb 16 '13 at 00:28
  • It's more than disabling auto build; but not sure what specific voodoo you have to go through before it finally works, other than cleaning, restarting eclipse, cleaning again. Completely ridiculous – wkhatch Apr 30 '13 at 15:31
  • 1
    I really can't believe it. It worked flawlessy for months, than I updated ADT and it stopped working (success rate 5% maybe..). Your solution worked perfectly...shame on ADT coders. – elbuild Oct 06 '13 at 21:23
  • I think for me it started when my project became bigger with about 10+ included library projects. I was wonder why when exporting APK eclipse is rebuilding the whole workspace. Now I realize that while building apk, the workspace is rebuilding also and eclipse is crashing. I was getting also errors that some library jar is not readable, because it was rebuilded in the same time. For smaller projects the eclipse rebuild faster and maybe crashing is not every time. – Borislav Gizdov Dec 02 '13 at 20:49
  • It was already disabled in my case. I just had to enable it and disable it again in order to work. – Dimosthenis Kontogiorgos Dec 27 '13 at 08:45
  • thank you man, you saved my time.. I am using macOS and I had this error in one project but I did what you wrote.. and It works. Thank you – ertan2002 Jan 19 '14 at 17:23
  • How is this even still a bug? – Rarw Feb 23 '14 at 23:31
  • Also if build automatically is checked, even thought eclipse would export but the exported apk will crash whenever you try to run it over your device (no compilation/execution errors in the debug). – Ziad Akiki Oct 20 '14 at 19:01
  • Eclipse and Android studio are more bug ridden than a cheap hostal mattress. Incredible. – Josh Jul 13 '15 at 10:45
  • I have been wrestling with this problem for a day. STS 3.6.4 + libgdx 1.6.1 on OSX. This combination used to work but for some reason it decided to fail when I was about to release (just to drive me crazy I guess). So this problem still lurks in the muddy waters and above solution worked like a charm for me. Thank you.! – Alp May 19 '16 at 10:07
12

Disable Project->Build Automatically. I've noted that this works for me.

nanofarad
  • 40,330
  • 4
  • 86
  • 117
wangzhengyi
  • 856
  • 8
  • 8
3

Disable project/build Automatically before export the apk.

enter image description here

Luna Kong
  • 3,065
  • 25
  • 20
0

This seem to be problem with your JVM. Can you update your java and check again. Also check this link

san
  • 1,845
  • 13
  • 23
  • Didn't do the trick I'm afraid! I installed this package here: http://support.apple.com/kb/DL1515 – whalabi Aug 01 '12 at 12:35
0

project/ clean worked for me. I think it could be related to the building of the project, as other users have posted.

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
0

The problem has gone until I have update ADT and Eclipse. I don't know which one solve the issue. Now it's working smoothly for severeal signed export, with:

  • ADT Version: 22.2.1.v201309180102-833290
  • Eclipse Juno Service Release 2 Build id: 20130225-0426
  • Gentoo Linux running Java 1.7.0_45-b18.

UPDATE: Few exports after, I still get crashes from time to time, but no very frequently.

Toni Gamez
  • 6,819
  • 1
  • 23
  • 18
0

may be you should try to add execute authority . you can try something like this

first close auto-build

cd /home/your name/android-dev/sdk/tools/

sudo chmod +x zipalign

done and good luck to you

SadieYu
  • 7
  • 2
0

I used the disable Build Automatically for months now, until I realized that AWS plugins were slowing down the entire launch process. I uninstalled all AWS plugins from Help->InstallationDetails and everything now works perfectly as before. I do not need to disable Build Automatically any more.

Siddharth
  • 9,349
  • 16
  • 86
  • 148