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

Web and WebWorks Development

Reply
Developer
Posts: 35
Registered: ‎01-28-2011
My Device: Not Specified

Packaging Bar file error - The command line is too long

I'm working on a windows machine. I've gotten several of the examples to install, so I know that I've set everything up correctly.

 

My app is all tested on my machine and I'm ready to test it on the simulator before uploading... except for the error listed below.

 

C:\bb\WebWorksPackagerPlayBook\bbwp>bbwp c:\a\TurnOutTheLight.zip /s c:\a /o c:\
a
[INFO]                  Parsing command line options
[INFO]                  Parsing bbwp.properties
[INFO]                  Validating WebWorks archive
[INFO]                  Parsing config.xml
[WARNING]               Failed to find a <feature> element
[INFO]                  Populating application source
[INFO]                  Compiling WebWorks application
[INFO]                  Packaging the bar file
The command line is too long.
[INFO]                  Bar packaging complete
[INFO]                  WebWorks application packaging complete

C:\bb\WebWorksPackagerPlayBook\bbwp>

 

There is a thread in the AirPlay forum that references the number of image files, but provides no solution.  Would a large number of image files cause this error?

 

Can I package it manually? Can I get more detail on what the command line it was attempt to run was?

 

I was hoping to submit tonight after a quicktest on the simulator, but am now blocked.

 

any suggestions are welcome.

Developer
Posts: 35
Registered: ‎01-28-2011
My Device: Not Specified

Re: Packaging Bar file error - The command line is too long

FYI - using verbose was not helpful.

 

C:\bb\WebWorksPackagerPlayBook\bbwp>bbwp c:\a\TurnOutTheLight.zip /s c:\a /o c:\
a /v
[INFO]                  Parsing command line options
[INFO]                  Parsing bbwp.properties
[INFO]                  Validating WebWorks archive
[INFO]                  Parsing config.xml
[INFO]                  Validating config.xml
[INFO]                  Validating application version
[WARNING]               Failed to find a <feature> element
[INFO]                  Validating the <name> element
[INFO]                  Validating the <author> element
[INFO]                  Populating application source
[INFO]                  Compiling WebWorks application
Loading configuration file C:\bb\WebWorksPackagerPlayBook\bbwp\blackberry-tablet
-sdk\frameworks\air-config.xml
C:\a\src\TurnOutTheLight.swf (26689 bytes)
[INFO]                  Packaging the bar file
The command line is too long.
[INFO]                  Bar packaging complete
[INFO]                  WebWorks application packaging complete

C:\bb\WebWorksPackagerPlayBook\bbwp>

 

 

Developer
Posts: 35
Registered: ‎01-28-2011
My Device: Not Specified

Re: Packaging Bar file error - The command line is too long

FYI - I reworked my app to use fewer image files and it packaged correctly. No idea what the limit is or even why there IS a limit, however I worked around the problem.

 

I was never able to get sound to work via the simulator either, so I decided to pull it out of this version so I can get deployed.

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Packaging Bar file error - The command line is too long

Hello,

 

How many total files do you estimate you had in your application when you were seeing this compiler error?  How many total files did you have after reducing the number of images?

 

As context, the WebWorks packager utility needs to process all resource files.  So if there is in fact a correlation between the number of packaged resources, and using the WebWorks command line utility, I'd like to find it.

 

Sincerely,

Adam

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 35
Registered: ‎01-28-2011
My Device: Not Specified

Re: Packaging Bar file error - The command line is too long

I was being a bad lazy programmer, Smiley Sad so it was pushing 600.

 

I reduced that by about 400.  I can get exact numbers if needed.

 

BTW - if I can hijack my own thread. How (on the playbook) would I play a WAV file from javascript? i.e. play a click sound to give auditory feedback.  I tried embed and object, but neither worked right

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Packaging Bar file error - The command line is too long

Okay thanks for confirming.  Although 400+ does seem like a large amount of files, I would expect that WebWorks developers who offer photo album apps, or make use of rich JS/CSS templates may encounter this boundary.  Thanks for bringing this to my attention.

 

To answer your question about media, using an HTML5 audio element is one way of playing WAV files from JavaScript .

 

Here's an example that I'm going to show in tomorrow's Webcast #3:

 

 

function playSound(audio_file)
{
   var ele = document.getElementById("audio");
   ele.src="local:///files/" + audio_file;
   ele.play();
}

...

<audio preload="auto" style="visibility: hidden;" id="audio"></audio>

<div class="pianokey" onclick="playSound('C.mp3')"></div>
<div class="pianokey" onclick="playSound('Csharp.mp3')"></div>
<div class="pianokey" onclick="playSound('D.mp3')"></div>

 

 

Disclaimer: The current version of the PlayBook simulator does not have the necessary codecs installed in order to play HTML5 audio.  However the above technique should work on a live device.

 

 

~ Adam

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 35
Registered: ‎01-28-2011
My Device: Not Specified

Re: Packaging Bar file error - The command line is too long

That is almost identical to the code that I had which was failing on the simulator.  I pulled it out because it was throwing a hard javascript error (preventing further execution) and I didn't want to submit an app which didn't work. I was too frustrated to think to put code around allowing it to fail gracefully.

 

Once I get a real device and can validate that code works, I can submit an update that has the sound put back in.  It really does help the app.

 

Thanks.

Developer
Posts: 125
Registered: ‎01-17-2011
My Device: Playbook
My Carrier: Vodacom

Re: Packaging Bar file error - The command line is too long

 

As far as I know the latest simulator (beta2) doesn't support sound.

 

Also using html5 audio playback - works in normal but doesn't play any sound in simulator.

 

Recall reading that audio and video don't work yet. - (for video the workaround was to use the bb media player)

 

.H

Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: Packaging Bar file error - The command line is too long

Hey Adam,

 

has there been any work on this topic, yet?

Seems like some guys have the same problem: http://supportforums.blackberry.com/t5/Web-Development/bbwp-fails-to-pack/td-p/798467

 

I guess this is Windows-specific as the number of characters that can be entered into a single command is limited to 2^13 (8191 - including spaces).

 

But this is urgent...

 

Is there any ugly manual workaround?

Perhaps it is possible to split the "Packaging the bar file" command up?

- - -
My approved apps @ App World
Contributor
Posts: 36
Registered: ‎04-06-2010
My Device: Bold 9700
My Carrier: AT&T

Re: Packaging Bar file error - The command line is too long

I believe I found the answer to this.  If you look at Command prompt (Cmd. exe) command-line string limitation you will see an 8191 character limit.

 

I think in the bbwp\blackberry-tablet-sdk\bin\blackberry-airpackager.bat where the %* is being used, blows out that limit.  To test, I put an @echo %* in that bat, and saw problems when I started getting around that 8k limit. I sure the rest of that bat files command line and the %~dp0 expansion help contribution to the total size, but I am not an expert here.

 

So, it's probably not a file count limit, but a total file name and path character limit.  The %* seems to expand to:

-package -target bar-debug -buildId 0 C:\Temp\bin\XXX.bar XXX-app.xml XXX.swf F1 F2 subdir/F3 subdir/FN

Where XXX represents my app zip file (e.g. XXX.ZIP) and F1 - FN are the filenams and paths.

 

I was also able to get an The syntax of the command is incorrect. error during my testing.

 

Until this is fixed, it seems like I will have to rename my files to have really short names.  Also, this was really hard to find and now I'm a couple days behind on my app.  Smiley Sad