Very Odd "Out of Memory Exception" during build. H

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Very Odd "Out of Memory Exception" during build. H

Postby mediahaze » Thu Sep 18, 2008 4:13 pm

New to Android,

Running Vista(x86) with 4gigs of ram,java 1.6.7,eclipse 3.4, lastest version of ADT and having a very odd problem when I try to build my android project.

As ADT try's to build a .apk file - I get a out of memory error which is really confusing me.
Clearly I am out of heapspace while trying to sign a key but...really?!? Something seems off here and I hope someone can point me in the right direction.

]
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.io.WinNTFileSystem.list(Native Method)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.io.File.list(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.provider.SeedGenerator$1.run(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.security.AccessController.doPrivileged(Native Method)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.provider.SeedGenerator.getSystemEntropy(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.provider.SecureRandom.engineNextBytes(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.security.SecureRandom.nextBytes(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.randomBits(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.<init>(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.largePrime(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.probablePrime(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.rsa.RSAKeyPairGenerator.generateKeyPair(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at java.security.KeyPairGenerator$Delegate.generateKeyPair(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.x509.CertAndKeyGen.generate(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.doGenKeyPair(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.doCommands(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.run(Unknown Source)
[2008-09-18 10:46:34 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.main(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.io.WinNTFileSystem.list(Native Method)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.io.File.list(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.provider.SeedGenerator$1.run(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.security.AccessController.doPrivileged(Native Method)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.provider.SeedGenerator.getSystemEntropy(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.provider.SecureRandom.engineNextBytes(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.security.SecureRandom.nextBytes(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.randomBits(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.<init>(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.largePrime(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.probablePrime(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.rsa.RSAKeyPairGenerator.generateKeyPair(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at java.security.KeyPairGenerator$Delegate.generateKeyPair(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.x509.CertAndKeyGen.generate(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.doGenKeyPair(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.doCommands(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.run(Unknown Source)
[2008-09-18 10:53:54 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.main(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.io.WinNTFileSystem.list(Native Method)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.io.File.list(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.provider.SeedGenerator$1.run(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.security.AccessController.doPrivileged(Native Method)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.provider.SeedGenerator.getSystemEntropy(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.provider.SecureRandom.engineNextBytes(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.security.SecureRandom.nextBytes(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.randomBits(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.<init>(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.largePrime(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.math.BigInteger.probablePrime(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.rsa.RSAKeyPairGenerator.generateKeyPair(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at java.security.KeyPairGenerator$Delegate.generateKeyPair(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.x509.CertAndKeyGen.generate(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.doGenKeyPair(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.doCommands(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.run(Unknown Source)
[2008-09-18 10:56:35 - HelloAndroid] Signing Key Creation: at sun.security.tools.KeyTool.main(Unknown Source)
mediahaze
Freshman
Freshman
 
Posts: 5
Joined: Thu Sep 18, 2008 4:00 pm

Top

Postby plusminus » Thu Sep 18, 2008 4:21 pm

Seems like the signer is stuck in a loop :shock:

Never seen such, sorry.
/plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby mediahaze » Thu Sep 18, 2008 4:24 pm

Arg.

Is anyone using the same setup as me version wise?
mediahaze
Freshman
Freshman
 
Posts: 5
Joined: Thu Sep 18, 2008 4:00 pm

Postby plusminus » Thu Sep 18, 2008 8:04 pm

Maybe the keystore was not properly defined. Saw a linux-user having such a problem.

:?
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby mediahaze » Thu Sep 18, 2008 8:51 pm

That could be possible. Any idea how I would properly define the keystore?

I noticed that when I build that I haven't been able to create a debug.keystore file. This makes sense in that the build process fails before doing creating the file.
mediahaze
Freshman
Freshman
 
Posts: 5
Joined: Thu Sep 18, 2008 4:00 pm

Postby plusminus » Thu Sep 18, 2008 9:03 pm

Dunno, when I had to anything with keystore stuff, I copied the commands somewhere from the net :roll:
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby Xav » Fri Sep 19, 2008 2:06 am

Hi Mediahaze,

it looks like the external execution of keytool is failing.

Try this command line from a shell

keytool -genkey -alias androiddebugkey - keyalg RSA -validity 365 -keypass android -keystore debug.keystore -storepass android
(you'll get prompted for name, organization, country, etc... Values won't matter since it's a debug key)

This should create the same debug keystore than ADT. If it fails with the same output (minus the header added by ADT), then the problem might be some configuration of your JDK.
User avatar
Xav
Junior Developer
Junior Developer
 
Posts: 11
Joined: Fri Dec 14, 2007 3:09 am
Location: Mountain View, CA

Postby mediahaze » Fri Sep 19, 2008 4:51 am

Xav,

Thanks for the response. It does indeed look like my JDK is the issue as the above code produces the same trace.

Any ideas how to resolve this?

Thanks again,
mediahaze
Freshman
Freshman
 
Posts: 5
Joined: Thu Sep 18, 2008 4:00 pm

Postby Xav » Sat Sep 20, 2008 1:00 am

I would just reinstall the JDK and see if that helps.

Xav
User avatar
Xav
Junior Developer
Junior Developer
 
Posts: 11
Joined: Fri Dec 14, 2007 3:09 am
Location: Mountain View, CA

Postby mediahaze » Sat Sep 20, 2008 3:12 am

Xav,

Thanks again.

I had previously re-installed 1.6 and just now tried an install of 1.5 with zero luck.

This is insane.

i'll try posting in the sun forums.
mediahaze
Freshman
Freshman
 
Posts: 5
Joined: Thu Sep 18, 2008 4:00 pm

Re: Very Odd "Out of Memory Exception" during build. H

Postby wgrand » Tue Nov 01, 2011 11:39 pm

I'm having the same issue. It seems that there is something wrong with my keychain
wgrand
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 01, 2011 11:38 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 9 guests