12-13-2011 01:05 PM
avoiding the IDE altogether; i have been working with command line environment to build and deploy applications. downloading the examples and then setting up the environment, enable dev mode, deploy debug token (fun fun fun); i managed to get the applications built and deployed onto the device as follows:
# build application
make
# create package
blackberry-nativepackager -package playbook-$APP.bar -buildId build.txt bar-descriptor.xml -devMode -debugToken ~/Library/Research\ In\ Motion/debugtoken1.bar -e arm/o.le-v7/$APP $APP *.png
blackberry-deploy -installApp -package playbook-$APP.bar -device $DEVICE -password $PASSWORD
all the applications installed without any problems - they started; then immediately exit - so something was going wrong. after ssh'ing into the playbook (another information search to figure that out) to see what was going on; i found the following was the cause of the problem:
$ cd /apps/com.example.CubeRotate.testDev__CubeRotate4a
$ ./native/CubeRotate
unknown symbol: navigator_request_events
unknown symbol: navigator_get_domain
unknown symbol: navigator_rotation_lock
unknown symbol: screen_get_domain
ldd:FATAL: Could not resolve all symbols
originally; the playbook hardware was using 1.0.7, upgrading to 1.0.8 made no effect to the results of the testing. i checked the documentation; the libraries are correctly linked.. will have a beer to see if i can figure something else out. the only sample application that actually works is 'HelloWorldConsole' - it seems that there is something with binding to the other applications..
any insight to figuring out why this is a problem would be a great assistance.
i tend to try to figure these things out on my own; but, i checked the libraries are all linked as per the documentation for the functions, so the symbol link is something simple which i have overlooked.
12-13-2011 01:09 PM
NDK 1.0 shipped with a library libbps.so in target-override folder which is not the same on device (all libraries in this folder are newer versions or don't exist on device). Because it diffrent on device you have to package it into your bar file. And set the LD_LIBRARY_PATH to pick it up. Normally IDE would do this for you.
12-13-2011 01:38 PM
mm - i figured something like that
<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="lib"/>
is within the 'bar_descriptor.xml' - which is the LD_LIBRARY_PATH i believe you are talking about - i updated my build process to do:
export SDK=/opt/PlaybookSDK
# create package
blackberry-nativepackager -package playbook-$APP.bar -buildId build.txt bar-descriptor.xml -devMode -debugToken ~/Library/Research\ In\ Motion/debugtoken1.bar -e $SDK/target/qnx6/armle-v7/usr/lib/libbps.so lib/libbps.so -e arm/o.le-v7/$APP $APP *.png
so include 'libbps.so' - but i tried various combinations for LD_LIBRARY_PATH - no go. what is the IDE doing specifically? any examples to demonstration how this post-packaging occurs? i think we are getting closer
the libbps.so file exists on the device, deployed under:
/apps/com.example.HelloWorldConsole.testDev_orldCo
the 'HelloWorldConsole' binary exists under:
/apps/com.example.HelloWorldConsole.testDev_orldCo
not nice when the IDE does things magically especially when there are command line tools - can someone host an example .bar file somewhere? i can then poke around and see what magic the IDE is doing under the hood.. always love poking around.
12-13-2011 01:42 PM
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
12-13-2011 01:49 PM
$ find ./
./
./META-INF
./META-INF/MANIFEST.MF
./native
./native/lib
./native/lib/libbps.so
./native/HelloWorldConsole
./native/icon.png
./native/bar-descriptor.xml
and..
$ cat native/bar-descriptor.xml
...
<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
</qnx>
still something fishy going on - trying to start the application many ways; gives the same errors
$ pwd
/apps/com.example.HelloWorldConsole.testDev_orldCo
$ ./native/HelloWorldConsole
unknown symbol: navigator_request_events
ldd:FATAL: Could not resolve all symbols
$ cd native/
$ ./HelloWorldConsole
unknown symbol: navigator_request_events
ldd:FATAL: Could not resolve all symbols
12-13-2011 02:16 PM
12-13-2011 02:19 PM
@cdamus - now you got it
launching from the launcher with these changes (including -e .../libbps.so) makes it work.
12-14-2011 02:04 AM
just to follow up - to get the compile process working from the command line:
bar_descriptor.xml
<asset path="${QNX_TARGET}/../target-override/${CPUVARDIR
indicates that the file "libbps.so" must be provided in the application bundle (from target-override) and named 'libbps.so.1'
-e $SDK/target/target-override/armle-v7/usr/lib/libbp
is the process for doing this - i hope this thread helps others who want to avoid using the IDE for development and going old-skool via the command line
the LD_LI BRARY_PATH needs to be app/native/lib which effectively ends up being {app_space}/native/lib in the binary
unzip -l playbook-HelloWorldConsole.bar
Archive: playbook-HelloWorldConsole.bar
Length Date Time Name
-------- ---- ---- ----
1599 12-13-11 20:13 META-INF/MANIFEST.MF
121904 12-13-11 20:13 native/lib/libbps.so.1 <---- here it is ![]()
8282 12-13-11 20:13 native/HelloWorldConsole
6078 12-13-11 20:13 native/icon.png
4859 12-13-11 20:13 native/bar-descriptor.xml
-------- -------
142722 5 files