"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Vuforia AIR Native Extension

Hello, everybody. I'm trying to make a Vuforia AIR native extension and have run into a problem.

Java class is similar to the class shown here: http://help.adobe.com/en_US/air/extensions/WS39e706a46ad531be-49badd05132afbce693-8000.html

This class is not an Activity, because I don't want it to be. The rendering of the surface will be done in AIR and not on a SurfaceView.

The java part of the native extension loads the .so files just fine.

The problem I have is with the QCAR.setInitParameters.I'm using the Native Extension context to get an activity for init parameters. 

The app crashes and this is shown in the LogCat:

 

11-20 11:09:51.734: D/ArTest(6141): APPSTATUS_INIT_APP

11-20 11:09:51.734: D/ArTest(6141): initApplication

11-20 11:09:51.734: D/ArTest(6141): APPSTATUS_INIT_QCAR

11-20 11:09:51.734: D/ArTest(6141): createContext java part init

11-20 11:09:51.744: D/ArTest(6141): try to QCAR.setInitParameters

11-20 11:09:51.754: I/DEBUG(3282): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

11-20 11:09:51.754: I/DEBUG(3282): Build fingerprint: 'htc_wwe/htc_vision/vision/vision:2.2.1/FRG83D/317545:user/release-keys'

11-20 11:09:51.754: I/DEBUG(3282): pid: 6141, tid: 6157  >>> air.air.Away3dTest <<<

11-20 11:09:51.754: I/DEBUG(3282): thread: AsyncTask #1

11-20 11:09:51.754: I/DEBUG(3282): signal 11 (SIGSEGV), fault addr 00000000

11-20 11:09:51.754: I/DEBUG(3282):  r0 00000000  r1 00310638  r2 82bf3ce0  r3 4da08f00

11-20 11:09:51.754: I/DEBUG(3282):  r4 00000000  r5 82fe5970  r6 00000000  r7 00001060

11-20 11:09:51.754: I/DEBUG(3282):  r8 82149605  r9 00310638  10 82bf3ce0  fp 4da08ed8

11-20 11:09:51.754: I/DEBUG(3282):  ip 00001060  sp 4da08af8  lr 82149625  pc 8214962c  cpsr 40000030

11-20 11:09:51.754: I/DEBUG(3282):  d0  6472656767756265  d1  41adad1041876f00

11-20 11:09:51.754: I/DEBUG(3282):  d2  41876ecc41876e01  d3  41876f3441876f01

11-20 11:09:51.754: I/DEBUG(3282):  d4  418c3a58418c3a24  d5  418c3ac0418c3a8c

11-20 11:09:51.754: I/DEBUG(3282):  d6  418c3b28418c3af4  d7  418c3b90418c3b5c

11-20 11:09:51.754: I/DEBUG(3282):  d8  3f80000041880000  d9  43e0000000000000

11-20 11:09:51.754: I/DEBUG(3282):  d10 41dfffffffc00000  d11 c3e0000000000000

11-20 11:09:51.754: I/DEBUG(3282):  d12 0000000000000000  d13 0000000000000000

11-20 11:09:51.754: I/DEBUG(3282):  d14 0000000000000000  d15 0000000000000000

11-20 11:09:51.754: I/DEBUG(3282):  d16 002d44680000001c  d17 3f80000000000000

11-20 11:09:51.754: I/DEBUG(3282):  d18 3fab8550d62bfb69  d19 3fd5555555555563

11-20 11:09:51.754: I/DEBUG(3282):  d20 0000000000000000  d21 3f782d02e8dd8bf7

11-20 11:09:51.754: I/DEBUG(3282):  d22 3f96ac9c0e3c8aa0  d23 3f8261052f31a88b

11-20 11:09:51.754: I/DEBUG(3282):  d24 3f582b387a8b46c3  d25 3f6dcabc44c1354d

11-20 11:09:51.754: I/DEBUG(3282):  d26 3f3083771072f0d7  d27 3f43754291ec7ccf

11-20 11:09:51.754: I/DEBUG(3282):  d28 3f133abc50c36001  d29 3f1420ec90674fac

11-20 11:09:51.754: I/DEBUG(3282):  d30 3efb2a7074bf7ad4  d31 3ff0000000000000

11-20 11:09:51.754: I/DEBUG(3282):  scr 80000013

11-20 11:09:51.834: V/WindowManager(1309): Remove Window{479de7c8 air.air.Away3dTest/air.air.Away3dTest.AppEntry paused=false}: mSurface=Surface(name=air.air.Away3dTest/air.air.Away3dTest.AppEntry, identity=603) mExiting=false isAnimating=false app-animation=null inPendingTransaction=false mDisplayFrozen=false

11-20 11:09:51.844: E/WindowManager(1309): return in removeWindowLocked

11-20 11:09:51.904: D/libEGL(6141): loaded /system/lib/egl/libGLES_android.so

11-20 11:09:51.904: I/DEBUG(3282):          #00  pc 8214962c  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.904: I/DEBUG(3282):          #01  lr 82149625  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.904: I/DEBUG(3282): code around pc:

11-20 11:09:51.904: I/DEBUG(3282): 8214960c 4604c158 4855447d 4689b084 300cf855 

11-20 11:09:51.904: I/DEBUG(3282): 8214961c 68004478 47984692 f88d2600 90036008 

11-20 11:09:51.904: I/DEBUG(3282): 8214962c 6cca6801 4790210c 494d6820 44796983 

11-20 11:09:51.904: I/DEBUG(3282): 8214963c 47984620 28004606 f8dfd066 f8558128 

11-20 11:09:51.904: I/DEBUG(3282): 8214964c 47902008 28004680 6820d05e 4a464631 

11-20 11:09:51.904: I/DEBUG(3282): code around lr:

11-20 11:09:51.904: I/DEBUG(3282): 82149604 47f0e92d f8df4d55 4604c158 4855447d 

11-20 11:09:51.904: I/DEBUG(3282): 82149614 4689b084 300cf855 68004478 47984692 

11-20 11:09:51.904: I/DEBUG(3282): 82149624 f88d2600 90036008 6cca6801 4790210c 

11-20 11:09:51.904: D/libEGL(6141): loaded /system/lib/egl/libEGL_adreno200.so

11-20 11:09:51.904: I/DEBUG(3282): 82149634 494d6820 44796983 47984620 28004606 

11-20 11:09:51.904: I/DEBUG(3282): 82149644 f8dfd066 f8558128 47902008 28004680 

11-20 11:09:51.904: I/DEBUG(3282): stack:

11-20 11:09:51.904: I/DEBUG(3282):     4da08ab8  47695018  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.904: I/DEBUG(3282):     4da08abc  0000004a  

11-20 11:09:51.904: I/DEBUG(3282):     4da08ac0  477102a8  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.904: I/DEBUG(3282):     4da08ac4  400112d0  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)

11-20 11:09:51.904: I/DEBUG(3282):     4da08ac8  00000000  

11-20 11:09:51.904: I/DEBUG(3282):     4da08acc  afd103c0  /system/lib/libc.so

11-20 11:09:51.904: I/DEBUG(3282):     4da08ad0  afd43730  /system/lib/libc.so

11-20 11:09:51.904: I/DEBUG(3282):     4da08ad4  0000002b  

11-20 11:09:51.914: I/DEBUG(3282):     4da08ad8  002d4eb8  [heap]

11-20 11:09:51.914: I/DEBUG(3282):     4da08adc  00000000  

11-20 11:09:51.914: I/DEBUG(3282):     4da08ae0  4da08b78  

11-20 11:09:51.914: I/DEBUG(3282):     4da08ae4  44049e84  

11-20 11:09:51.914: I/DEBUG(3282):     4da08ae8  00000000  

11-20 11:09:51.914: I/DEBUG(3282):     4da08aec  afd103c0  /system/lib/libc.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08af0  df002777  

11-20 11:09:51.914: I/DEBUG(3282):     4da08af4  e3a070ad  

11-20 11:09:51.914: I/DEBUG(3282):     4da08af8  82c2e4d8  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08afc  477394b8  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.914: I/DEBUG(3282):     4da08b00  82da6300  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b04  00000000  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b08  00000000  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b0c  4da08b64  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b10  82fe5970  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b14  00001060  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b18  82149605  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b1c  82bf3ce0  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b20  44049ea0  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b24  8214a215  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b28  82fe5970  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b2c  4da08b64  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b30  476d17e8  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.914: I/DEBUG(3282):     4da08b34  80a49601  /system/lib/libdvm.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b38  82da63d8  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b3c  44049eb8  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b40  44049ea0  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b44  82869811  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b48  00000068  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b4c  80a7f2b9  /system/lib/libdvm.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b50  4da08bb0  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b54  80a676d5  /system/lib/libdvm.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b58  476d6570  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.914: I/DEBUG(3282):     4da08b5c  00000002  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b60  41ad4708  /dev/ashmem/dalvik-LinearAlloc (deleted)

11-20 11:09:51.914: I/DEBUG(3282):     4da08b64  00000000  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b68  4da08ba0  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b6c  00000004  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b70  44049eb4  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b74  44049ec0  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b78  4da08b80  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b7c  80a171b8  /system/lib/libdvm.so

11-20 11:09:51.914: I/DEBUG(3282):     4da08b80  002cf4e8  [heap]

11-20 11:09:51.914: I/DEBUG(3282):     4da08b84  41ad3c90  /dev/ashmem/dalvik-LinearAlloc (deleted)

11-20 11:09:51.914: I/DEBUG(3282):     4da08b88  44049eb4  

11-20 11:09:51.914: I/DEBUG(3282):     4da08b8c  4da08c20  

11-20 11:09:51.924: I/DEBUG(3282):     4da08b90  80a17380  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08b94  002cf4e8  [heap]

11-20 11:09:51.924: I/DEBUG(3282):     4da08b98  4da08ba0  

11-20 11:09:51.924: I/DEBUG(3282):     4da08b9c  80a4592f  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08ba0  44049eb4  

11-20 11:09:51.924: I/DEBUG(3282):     4da08ba4  45f87f00  /data/dalvik-cache/data@app@air.air.Away3dTest-1.apk@classes.dex

11-20 11:09:51.924: I/DEBUG(3282):     4da08ba8  828697a1  /data/data/com.adobe.air/lib/libCore.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08bac  4da08c20  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bb0  000a7a60  [heap]

11-20 11:09:51.924: I/DEBUG(3282):     4da08bb4  00000001  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bb8  0024c3d8  [heap]

11-20 11:09:51.924: I/DEBUG(3282):     4da08bbc  45f865c0  /data/dalvik-cache/data@app@air.air.Away3dTest-1.apk@classes.dex

11-20 11:09:51.924: I/DEBUG(3282):     4da08bc0  44049ecc  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bc4  4da08c18  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bc8  477394b8  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.924: I/DEBUG(3282):     4da08bcc  80a1c124  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08bd0  3f800000  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bd4  4da08c18  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bd8  0030ef28  [heap]

11-20 11:09:51.924: I/DEBUG(3282):     4da08bdc  002cf4f0  [heap]

11-20 11:09:51.924: I/DEBUG(3282):     4da08be0  00017058  [heap]

11-20 11:09:51.924: I/DEBUG(3282):     4da08be4  000003b4  

11-20 11:09:51.924: I/DEBUG(3282):     4da08be8  80aa3334  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08bec  80aa7f68  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08bf0  4da08ed8  

11-20 11:09:51.924: I/DEBUG(3282):     4da08bf4  80a22e98  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08bf8  002cf4e8  [heap]

11-20 11:09:51.924: D/libEGL(6141): loaded /system/lib/egl/libGLESv1_CM_adreno200.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08bfc  4da08c18  

11-20 11:09:51.924: I/DEBUG(3282):     4da08c00  80a22e18  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08c04  00000000  

11-20 11:09:51.924: I/DEBUG(3282):     4da08c08  000003b4  

11-20 11:09:51.924: I/DEBUG(3282):     4da08c0c  80a21d34  /system/lib/libdvm.so

11-20 11:09:51.924: I/DEBUG(3282):     4da08c10  00000000  

11-20 11:09:51.924: I/DEBUG(3282):     4da08c14  00000000  

11-20 11:09:51.924: I/DEBUG(3282):     4da08c18  420fe298  /system/framework/core.odex

11-20 11:09:51.924: I/DEBUG(3282):     4da08c1c  44049f48  

11-20 11:09:51.924: I/DEBUG(3282):     4da08c20  476d17e8  /dev/ashmem/mspace/dalvik-heap/2 (deleted)

11-20 11:09:51.934: I/DEBUG(3282):     4da08c24  002d4eb8  [heap]

11-20 11:09:51.934: I/DEBUG(3282):     4da08c28  41ada150  /dev/ashmem/dalvik-LinearAlloc (deleted)

11-20 11:09:51.934: I/DEBUG(3282):     4da08c2c  0024c3a0  [heap]

11-20 11:09:51.934: I/DEBUG(3282):     4da08c30  002cf4e8  [heap]

11-20 11:09:51.934: I/DEBUG(3282):     4da08c34  4da08bd0  

11-20 11:09:51.934: I/DEBUG(3282):     4da08c38  44047300  

11-20 11:09:51.934: I/DEBUG(3282):     4da08c3c  002cf4f0  [heap]

11-20 11:09:51.934: I/DEBUG(3282):     4da08c40  80aa832a  

 Can I make this work? 

AlessandroB

Wed, 11/21/2012 - 16:52

thanks for the information; that allows me to exclude some possible issues affecting the setInitParameters() in older version of Vuforia when running on ICS.

In your case, everything is fine on that side.

Hard to tell then what can make it fail with AIR;

markovidmar

Thu, 11/22/2012 - 19:05

I did what you suggested. While doing it, I realised I forgot to init mQCARFlags.
Could be a problem I'm not making the calls from an Activity?

AlessandroB

Fri, 11/23/2012 - 08:44

Hi, setting the mQCARflags is a fundamental step, as it allows QCAR to know if you are using OpenGL ES 1.1 or 2.0, so you must set it of course before getting to the setInitParmaters.

markovidmar

Sun, 11/25/2012 - 11:54

I tried what you have suggested but it still throws the same error as before.
I guess I won't be able to do what I want with current API.

AlessandroB

Tue, 11/27/2012 - 10:27

Hi, the reason for passing the activity parameter to qcar init is that QCAR will store some low-level information on the activity; this is really about low level details of QCAR impleemntation I cannot describe here.

AlessandroB

Tue, 11/27/2012 - 12:40

One extra note:

I searched the internet and found many forums discussing a similar crash (signal 11 etc.) occurring with Adobe AIR on Android in various circumstances, here is an example (but you can find many others):

markovidmar

Mon, 12/24/2012 - 10:21

I'm glad someone else is interested in this project. And I've made some progress creating the extension.

Awesome that you have made good progress.  I have been a flash developer/designer for many years now and I had recently started my own AR engine in AS3, but like most others, I have found that it is way too slow to make the calculations on the AIR side.

Since I have hardly programmed in Java, Objective C, just started taking a look at this SDK, and has not done any native extensions, take what I say with a micro grain of salt :P

AlessandroB

Fri, 12/28/2012 - 22:31

Guys, great to see that you're making such good progress on the AIR side; I'm following your discussion with interest. 

markovidmar

Fri, 01/04/2013 - 10:57

I was unsuccessfully trying to send bitmapdata over jni from java to air. Too damn slow. 1-2 fps. I was so close to giving up, when I tried one last thig.

Hi markovidmar, when you're done with your amazing work, it would be really great if you could post here a complete step-by-step solution (not the whole code, but just the process and a few relevant code snippets where appropriate); that would be very valuable for other possible Adobe AIR + V