Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Development

Reply
Developer
Posts: 25
Registered: ‎03-27-2011
My Device: developer
My Carrier: Free Mobile

Fail while creating the package

Hi all, 

 

I have a strange failure while creating the package, or even launching Apk2barVerifier.

 

I have this Java callstack :

Click the "Details" button to see details
Packaging failed:1

C:\MyApps\Android\Eclipse\eclipse_3.6.1\eclipse>set version=1.0.2

C:\MyApps\Android\Eclipse\eclipse_3.6.1\eclipse>set LIB=C:\MyApps\Android\Eclipse\eclipse_3.6.1\eclipse\configuration\org.eclipse.osgi\bundles\410\1\.cp\blackberry.tools.SDK\bin\\..\lib

C:\MyApps\Android\Eclipse\eclipse_3.6.1\eclipse>java -Xmx512M -cp "C:\MyApps\Android\Eclipse\eclipse_3.6.1\eclipse\configuration\org.eclipse.osgi\bundles\410\1\.cp\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\MyApps\Android\Eclipse\eclipse_3.6.1\eclipse\configuration\org.eclipse.osgi\bundles\410\1\.cp\blackberry.tools.SDK\bin\\..\lib\Apk2Bar-1.0.2.jar" net.rim.tools.apk2bar.Apk2bar C:\Work\Android\Workspace\LetterGame\bin\LetterGame.apk C:\Install\Android\android-sdk_r08-windows\android-sdk-windows\ -t "C:\Work\Android\Workspace\LetterGame\dist\Android 3.1"
[BarGenerator]
[BarGenerator] Start packaging LetterGame.apk
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferByte.<init>(Unknown Source)
at java.awt.image.Raster.createPackedRaster(Unknown Source)
at java.awt.image.BufferedImage.<init>(Unknown Source)
at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at net.rim.tools.apk2bar.packager.AndroidManifestParser.getBetterIcon(AndroidManifestParser.java:153)
at net.rim.tools.apk2bar.packager.AndroidManifestParser.validateIcons(AndroidManifestParser.java:133)
at net.rim.tools.apk2bar.packager.AndroidManifestParser.parseManifest(AndroidManifestParser.java:79)
at net.rim.tools.apk2bar.packager.BarGenerator.generateBar(BarGenerator.java:179)
at net.rim.tools.apk2bar.packager.BarGenerator.generateBarBatch(BarGenerator.java:106)
at net.rim.tools.apk2bar.Apk2bar.apk2BarPackage(Apk2bar.java:310)
at net.rim.tools.apk2bar.Apk2bar.main(Apk2bar.java:238)

 

I also tried the online tool, but I get this (not very useful ) error :

"We're sorry, an error occurred while processing your request. The information has been registered and we're working on getting this fixed as soon as we can."

 

 

Does someone else have this kind of issue ?

What can I do about it ?

 

Here are some details :

I try to port my game :

Word Prospector

 

It's using my own Android library, and several middleware ( Admob and Scoreloop ).

 

I tried to convert the icon into a 86x86 png by myself, to avoid the issue, but it didn't change anything..



 

Thanks for any advice, 

 

 

Emmanuel / Alocaly

Developer
Posts: 25
Registered: ‎03-27-2011
My Device: developer
My Carrier: Free Mobile

Re: Fail while creating the package

Arghhh...

 

I finally found the culprit :

I have some raw data files ( compressed version of english dictionary for my game ).

 

And the bar packager tries to interpret them as icons !!!

 

By setting 4 Go for the java heap, the error is now more clear :

validateIcons: assets/lettersf.dict: Dimensions (width=1970949 height=2097024) are too large...

 

How can I prevent that ?

 

Thanks, 

 

Emmmanuel / Alocaly

Developer
Posts: 25
Registered: ‎03-27-2011
My Device: developer
My Carrier: Free Mobile

Re: Fail while creating the package

I investigated more on my issue, 

 

And it's even more strange :

I have 26 dictionary files ( one for each letters ).

And only 4 of them are interpreted as icon by Apk2Bar / apk2BarVerifier.

 

I tried to change their names, or their extensions, but it didn't change anything.

 

 

Could someone from RIM helps me with that ?

Is it possible to get rid of this icon verification ?

I sure can provide a file that create the issue...

Or do we have access to the sources of the apk2barVerifier ?

 

Thanks for any help, 

 

Emmanuel / Alocaly

 

 

 

Developer
Posts: 25
Registered: ‎03-27-2011
My Device: developer
My Carrier: Free Mobile

Re: Fail while creating the package

I finally find a way to create my package :

 

I tried changing the names of my files, but it didn't changed anything.

So I imaginated the packager was intepreting the start of my files, and some combinaisons were interpreted as an icon.

So I added a specific header to all of my files, changed the reader in my android app, and voilà !

 

It's now working !!

 

So :

1) if you experience the same issue, try to add an artificial header to your file

2) Rim : please fix your app2bar verifier so it doesn't incorrectly interpret the start of the files to mark them as "icons".

 

Emmanuel / Alocaly

New Member
Posts: 1
Registered: ‎02-11-2012
My Device: Blackberry Storm 2 9520
My Carrier: 914457128

Re: Fail while creating the package

I'm having the same problem. how can I add an artificial header to my file?

and then, what does the 2 point meen?

2) Rim : please fix your app2bar verifier so it doesn't incorrectly interpret the start of the files to mark them as "icons".

 

thanks

 

Nuno

Developer
Posts: 25
Registered: ‎03-27-2011
My Device: developer
My Carrier: Free Mobile

Re: Fail while creating the package

Sorry, i was travelling for my job, so couldn't answer more quickly.

 

To add an artificial header, I just made a small C program that open the file, add 4 characters at the start, and append the rest of the file behind it.

 

then in my android application, I skip the 4 first characters.

 

 

The second point was for RIM  (Reearch In motion => blackberry makers ). It would be really better if they could fix this bug on their side !

 

Emmanuel  / Alocaly