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

Adobe AIR Development

Reply
New Developer
Posts: 30
Registered: ‎11-02-2010
My Device: playbook
Accepted Solution

Exception IndexOutOfBoundsException when trying to deploy

Hi all,

 

i am facing a serious issue when i try to run or debug my app. I made this app in air 1 year ago and recompile it with the blackberry sdk (i also embed some swc libraries that i can't recompile).

When i try to debug or run i have an exception message :

 

 

Using default icon: C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\blackberry-tablet-sdk-0.9.0\bin\..\samples\icons\blackberry-tablet-default-icon.png
The bar manifest file is valid.
Package created: D:\Documents\EclipseProjects\Widget/Widget.bar
java.lang.IndexOutOfBoundsException
 at java.io.ByteArrayOutputStream.write(Unknown Source)
 at com.qnx.bbt.deploy.Deploy.readPackage(Deploy.java:173)
 at com.qnx.bbt.deploy.Deploy.verifyPackageId(Deploy.java:138)
 at com.qnx.bbt.deploy.Deploy.sendRequest(Deploy.java:124)
 at com.qnx.bbt.deploy.Deploy.run(Deploy.java:100)
 at com.qnx.bbt.deploy.Deploy.main(Deploy.java:73)
Error: null
Deployment failed: 1

 

I have no idea of what I did wrong, the blackberry test project works well, i copy/paste its app-xml file but nothing change. 

 

Any ideas or suggestions ? Thanks !

 

Developer
Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: Exception IndexOutOfBoundsException when trying to deploy

[ Edited ]

Wow, all morning I was running the AIRHelloWorld app fine, I just replaced the code with my own and kept updating the app in my simulator to test.  Then I decided to create another project from scratch and am now running into this issue with the original that was running fine, and now the new app that hasn't ever made it onto the simulated device.

 

here is my error output which is pretty much the exact same:

 

Using default icon: /Applications/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0/bin/../samples/icons/blackberry-tablet-default-icon.png
The bar manifest file is valid.
Package created: /Users/user_name_goes_here/Documents/Adobe Flash Builder 4/AIRHelloWorld/AIRHelloWorld.bar
java.lang.IndexOutOfBoundsException
	at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:88)
	at com.qnx.bbt.deploy.Deploy.readPackage(Deploy.java:173)
	at com.qnx.bbt.deploy.Deploy.verifyPackageId(Deploy.java:138)
	at com.qnx.bbt.deploy.Deploy.sendRequest(Deploy.java:124)
	at com.qnx.bbt.deploy.Deploy.run(Deploy.java:100)
	at com.qnx.bbt.deploy.Deploy.main(Deploy.java:73)
Error: null
Deployment failed: 1
java.lang.IndexOutOfBoundsException
	at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:88)
	at com.qnx.bbt.deploy.Deploy.readPackage(Deploy.java:173)
	at com.qnx.bbt.deploy.Deploy.verifyPackageId(Deploy.java:138)
	at com.qnx.bbt.deploy.Deploy.sendRequest(Deploy.java:124)
	at com.qnx.bbt.deploy.Deploy.run(Deploy.java:100)
	at com.qnx.bbt.deploy.Deploy.main(Deploy.java:73)
Error: null

 

 

 

--------------
kdittyr

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators
Developer
Posts: 85
Registered: ‎10-25-2010
My Device: Not Specified

Re: Exception IndexOutOfBoundsException when trying to deploy

Had the same issue and didn't get how to solve it. It happened with an application i already had done for Android and didn't get the same error when starting a project from scratch.

But the application was actually on the device so it seems like it wasn't a critical exception. Have a look at the simulator, see if it's there or not

 

Fabien

Hope this helps,
Fabien

--
1. If you liked my post or found it useful please click on the white star and provide a Kudo!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!
BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Exception IndexOutOfBoundsException when trying to deploy

This is known issues - bug in the packager - caused by lots of files packaged in your app.

 

The workaround:

Do not use -launchApp option of airpackager (or Launch options of FB integration),

use blackberry-deploy tool (command line) but instead of specifying -package <bar> option you have to explicitly specify -package-name and -package-id options. Package name you should know (comes from app.xml) but package id is unique name generated automatically - you can extract it from .bar file if you unzip it and check META-INF/MANIFEST.MF for Package-Id attribute (also package id is printed on console when you install the app on the simulator). 

Developer
Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: Exception IndexOutOfBoundsException when trying to deploy

When I created a new project it seemed to work fine.  I will try to clean the project and see if that works for me tomorrow.

--------------
kdittyr

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators
Highlighted
New Contributor
Posts: 8
Registered: ‎11-14-2010
My Device: Not Specified

Re: Exception IndexOutOfBoundsException when trying to deploy

Elena,

could you give a sample of command line?

I receive the same IndexOutOfBoundsException error in command line too.

And my copy of airpackager utility doesn't have package-name and package-id params.

Have you got an advanced version of airpackager? Smiley Happy

New Contributor
Posts: 8
Registered: ‎11-14-2010
My Device: Not Specified

Re: Exception IndexOutOfBoundsException when trying to deploy

Sorry,

my fault - "advanced" loader is blackberry-deploy utility. I was not attentive in previous post!

New Contributor
Posts: 2
Registered: ‎11-12-2010
My Device: Not Specified

Re: Exception IndexOutOfBoundsException when trying to deploy

This was caused with me by having image files in the project directory that I hadn't referenced in the code yet. They were basically extras that I was going to use later.
Contributor
Posts: 49
Registered: ‎11-18-2010
My Device: Flash Builder - PlayBook Simulator

Re: Exception IndexOutOfBoundsException when trying to deploy

I also have that IndexOutOfBoundsException but elena_laskavaia's tip doesn't work...

Here's the command line I'm using:

 

 

"C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\blackberry-tablet-sdk-0.9.0\bin\blackberry-deploy" -package-name [My app's ID] -package-id [My app's package ID] -installApp -launchApp
 -device [My simulator's IP]

 And here's what I get:

 

 

 

java.lang.NullPointerException
        at java.io.File.<init>(Unknown Source)
        at com.qnx.bbt.deploy.Deploy.sendRequest(Deploy.java:121)
        at com.qnx.bbt.deploy.Deploy.run(Deploy.java:100)
        at com.qnx.bbt.deploy.Deploy.main(Deploy.java:73)
Error: null

 

Any tip?

 

Contributor
Posts: 40
Registered: ‎11-21-2010
My Device: 9630
My Carrier: Verizon

Re: Exception IndexOutOfBoundsException when trying to deploy

This solves the problem for me. I have an assets folder under src. Put all my images in there and suddenly got the exact same error dump. I took them all out and I was able to deploy again. So I'm having to add them to the project AS I USE them. This is a little bit of a pain, but no biggie. I'd love to see a fix for it.

 

Is there any way to turn a forum thread into an issue in the bug tracker? That'd be nice right about now....

 

-=Cliff>



Dungeon Joe - A Touch-focused Strategy Game http://dungeonjoe.com