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

Native Development

Reply
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ
Accepted Solution

Issue using blackberry-nativepackager

[ Edited ]

I'm trying to use the nativepackager to build the AccelerometerSampleMakefile project, however I keep getting this error about the entry point:

 

Error: Attribute Entry-Point: file cannot be found in the list of packaged files: AccelerometerSampleMakefile

 

I am parsing the bar-descriptor.xml to go through and copy the list of assets, and I am making sure to include the active configuration asset as well (which is just the binary). I copy all the assets into folder 'generated-resources' and then run this command:

 

blackberry-nativepackager -package AccelerometerSampleMakefi.bar bar-descriptor.xml -e generated-resources .

 

If I replace the "-e generated-resources ." with "-C generated-resources" I get this error:

 

Error: !Invalid asset path "NOTICE"!

 

The examples in the blackberry-nativepackager docs show the entry-point binary being listed first. If I do that nothing changes.  Just to reiterate, the binary is under the generated-resources directory along with all the other assets listed in the bar-descriptor.xml.

 

(Sorry for any typos, I'm on a phone right now)

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Issue using blackberry-nativepackager

Can you give me full command line? -e option requires two arguments - local path then bar assest path.

When you specify entry point you specify it by bar asset path, if path does not match - it cannot find entry point

 

For example if you project looks like

 

mydir/bar-descriptor.xml

mydir/arm/mybinary

mydir/icon.png

 

You can package it like this

blackberry-nativepackager -package out.bar -devMode mydir/bar-descriptor.xml -C mydir/ -e mydir/arm/mybinary mybinary icon.png

 

Actually better to specify all your files in the xml

<asset path="arm/mybinary" entry="true">mybinary</asset>

<asset path="icon.png">icon.png</asset>

 

Then just bar bar-descriptor.xml to the packager (assuming you curdir is mydir)

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Issue using blackberry-nativepackager

[ Edited ]

The second argument for the -e is a period (.), which used to work when I originally used it with the airpackager, but maybe it has changed.

Regardless, I think the issue is that the assets are in the bar-descriptor.xml like you mentioned, however the bar-descriptor.xml is not in the same directory as the actual files. So if I understand correctly, anything listed as an asset in the bar-descriptor.xml will be automatically included, and I don't need to add them to the command line...

 

Edit: I can try this out later or tomorrow and report back.

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Issue using blackberry-nativepackager

When I don't include the files in the command line, I get this error:

Error: Unable to resolve path variable "QNX_TARGET"

 

The command line is:

blackberry-nativepackager -package target/AccelerometerSampleMakefi.bar bar-descriptor.xml

 

The issue is with this asset path:

 

<asset path="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib/libbps.so" type="Qnx/Elf">lib/libbps.so.1</asset>

 

Is there a way to pass  variables into the nativepackager, or am I going to have to populate a copy of the bar-descriptor.xml myself? 

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Issue using blackberry-nativepackager

Yes,

blackberry-nativepackager -D QNX_TARGET=<path>

 where <path> is actual path (or like $QNX_TARGET if it set in shell)

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Issue using blackberry-nativepackager

K, I'll give that a shot.

 

How about selecting the active configuration through id or name?

 

<configuration id="com.qnx.qcc.toolChain.443564715" name="Default">
	<platformArchitecture>armle-v7</platformArchitecture>
	<asset path="arm/o.le-v7-g/AccelerometerSampleMakefile" entry="true" type="Qnx/Elf">AccelerometerSampleMakefile</asset>
</configuration>
<configuration id="com.qnx.qcc.toolChain.1231044190" name="Device-Debug">
	<platformArchitecture>armle-v7</platformArchitecture>
	<asset path="arm/o.le-v7-g/AccelerometerSampleMakefile" entry="true" type="Qnx/Elf">AccelerometerSampleMakefile</asset>
</configuration>
<configuration id="com.qnx.qcc.toolChain.984880167" name="Device-Release">
	<platformArchitecture>armle-v7</platformArchitecture>
	<asset path="arm/o.le-v7/AccelerometerSampleMakefile" entry="true" type="Qnx/Elf">AccelerometerSampleMakefile</asset>
</configuration>
<configuration id="com.qnx.qcc.toolChain.2004874297" name="Simulator">
	<platformArchitecture>x86</platformArchitecture>
	<asset path="x86/o-g/AccelerometerSampleMakefile" entry="true" type="Qnx/Elf">AccelerometerSampleMakefile</asset>
</configuration>

 

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Issue using blackberry-nativepackager

[ Edited ]

Normally I would just get all these settings from the Eclipse output... but I can't package the NDK samples in momentics. When i select export as a release build, I just get this error:

 

Export failed.
java.lang.reflect.InvocationTargetException

 

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Issue using blackberry-nativepackager

to package specific configuration you add -configuration "Device-Debug"

or simimar to options list of packager

 

For the other error I don't have enought info, I would need full ide log (.log file in workspace)

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Issue using blackberry-nativepackager

[ Edited ]

Oh you know what, all of these are under -help-advanced. I didn't notice there was a second level of hidden args available.

 

Thanks.

 

I'll try to add the other error to JIRA.

 

Edit: The -D and -configuration worked. Thanks again!

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Issue using blackberry-nativepackager

[ Edited ]

The other error was that signing was enabled by default, but I have no signing keys. It's just a bad error message.

 

https://www.blackberry.com/jira/browse/TOOL-327