How to debug android SOLVED

I am trying to use the ofxCV calibrate camera to get a camera calibration file on android, it compiles fine but crashes, here is the logcat output.

10-03 21:56:42.901: E/Adreno-ES11(19783): <qglDrvAPI_glGetString:619>: GL_INVALID_ENUM
10-03 21:56:42.901: I/ofAppAndroidWindow(19783): setup
10-03 21:56:42.901: I/(19783): initializing camera with external texture
10-03 21:56:42.911: W/CameraBase(19783): An error occurred while connecting to camera: 0
10-03 21:56:42.911: E/(19783): ofPixels: format doesn't support channels
10-03 21:56:42.911: E/(19783): ofPixels: format doesn't support channels
10-03 21:56:42.911: E/(19783): ofPixels: format doesn't support channels
10-03 21:56:42.941: D/dalvikvm(19783): GC_FOR_ALLOC freed 178K, 3% free 9357K/9568K, paused 18ms, total 18ms
10-03 21:56:42.941: W/dalvikvm(19783): threadid=13: thread exiting with uncaught exception (group=0x41b4bba8)
10-03 21:56:42.941: E/AndroidRuntime(19783): FATAL EXCEPTION: GLThread 540
10-03 21:56:42.941: E/AndroidRuntime(19783): Process: cc.openframeworks.androidEmptyExample, PID: 19783
10-03 21:56:42.941: E/AndroidRuntime(19783): java.lang.RuntimeException: Fail to connect to camera service
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at android.hardware.Camera.native_setup(Native Method)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at android.hardware.Camera.<init>(Camera.java:351)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at android.hardware.Camera.open(Camera.java:325)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at cc.openframeworks.OFAndroidVideoGrabber.initGrabber(OFAndroidVideoGrabber.java:72)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at cc.openframeworks.OFAndroid.setup(Native Method)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at cc.openframeworks.OFAndroidWindow.setup(OFAndroidWindow.java:290)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at cc.openframeworks.OFAndroidWindow.onSurfaceChanged(OFAndroidWindow.java:282)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
10-03 21:56:42.941: E/AndroidRuntime(19783): 	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

Also, a related question, if I do get this to work how can I get the file it writes off the android device to use in another app?

Fred

Ok, I have been trying more with this and another app I am trying to make. At the moment I am using ofxAruco ar marker addon and some other open CV stuff ofxNetwork and some XML settings. Everything was fine and I made some chages to the code- added some audio and fonts. Now the app crashes on launch. The strange thing is now reverting to my old code also crashes on launch, cleaning has no effect either. Any help would be great- the output is mysterious to me, the error seems to be in the following lines, particularly : java.lang.UnsatisfiedLinkError: Native method not found: cc.openframeworks.OFAndroid.init:()V

How can I find out what this init function is? Is it the init of the OF android library?

10-06 07:00:38.649: E/AndroidRuntime(4191): FATAL EXCEPTION: Thread-979
10-06 07:00:38.649: E/AndroidRuntime(4191): Process: cc.openframeworks.androidEmptyExample, PID: 4191
10-06 07:00:38.649: E/AndroidRuntime(4191): java.lang.UnsatisfiedLinkError: Native method not found: cc.openframeworks.OFAndroid.init:()V
10-06 07:00:38.649: E/AndroidRuntime(4191): 	at cc.openframeworks.OFAndroid.init(Native Method)
10-06 07:00:38.649: E/AndroidRuntime(4191): 	at cc.openframeworks.OFAndroid$2.run(OFAndroid.java:311)
10-06 07:00:38.649: E/AndroidRuntime(4191): 	at java.lang.Thread.run(Thread.java:841)

here is the logcat from when I run the app to the crash- the whole thing, tough except for the above extract, nothing else is errors.

10-06 07:00:38.319: I/ActivityManager(588): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=cc.openframeworks.androidEmptyExample/.OFActivity (has extras)} from pid 4695

    10-06 07:00:38.429: D/dalvikvm(588): GC_FOR_ALLOC freed 1040K, 17% free 26483K/31536K, paused 114ms, total 114ms
    10-06 07:00:38.499: I/Exchange(1774): Ping expired for account 1
    10-06 07:00:38.519: D/dalvikvm(4191): Late-enabling CheckJNI
    10-06 07:00:38.519: I/ActivityManager(588): Start proc cc.openframeworks.androidEmptyExample for activity cc.openframeworks.androidEmptyExample/.OFActivity: pid=4191 uid=10157 gids={50157, 1028, 1015}
    10-06 07:00:38.579: D/dalvikvm(936): GC_CONCURRENT freed 419K, 6% free 10119K/10728K, paused 2ms+2ms, total 20ms
    10-06 07:00:38.599: I/NotifUtils(14122): Validating Notification, mapSize: 1 getAttention: true
    10-06 07:00:38.599: I/OF(4191): static init
    10-06 07:00:38.599: D/dalvikvm(4191): Trying to load lib /data/app-lib/cc.openframeworks.androidEmptyExample-1/libneondetection.so 0x41e8d678
    10-06 07:00:38.599: D/dalvikvm(4191): Added shared lib /data/app-lib/cc.openframeworks.androidEmptyExample-1/libneondetection.so 0x41e8d678
    10-06 07:00:38.599: D/dalvikvm(4191): No JNI_OnLoad found in /data/app-lib/cc.openframeworks.androidEmptyExample-1/libneondetection.so 0x41e8d678, skipping init
    10-06 07:00:38.599: I/OF(4191): loading neon optimized library
    10-06 07:00:38.599: D/dalvikvm(4191): Trying to load lib /data/app-lib/cc.openframeworks.androidEmptyExample-1/libOFAndroidApp_neon.so 0x41e8d678
    10-06 07:00:38.649: D/dalvikvm(4191): Added shared lib /data/app-lib/cc.openframeworks.androidEmptyExample-1/libOFAndroidApp_neon.so 0x41e8d678
    10-06 07:00:38.649: I/(4191): JNI_OnLoad called
    10-06 07:00:38.649: I/OF(4191): initializing app
    10-06 07:00:38.649: I/OF(4191): OFAndroid init...
    10-06 07:00:38.649: I/OF(4191): starting resources extractor
    10-06 07:00:38.649: W/dalvikvm(4191): No implementation found for native Lcc/openframeworks/OFAndroid;.init:()V
    10-06 07:00:38.649: W/dalvikvm(4191): threadid=12: thread exiting with uncaught exception (group=0x415b7ba8)
    10-06 07:00:38.649: I/OF(4191): sd mounted: true
    10-06 07:00:38.649: E/AndroidRuntime(4191): FATAL EXCEPTION: Thread-979
    10-06 07:00:38.649: E/AndroidRuntime(4191): Process: cc.openframeworks.androidEmptyExample, PID: 4191
    10-06 07:00:38.649: E/AndroidRuntime(4191): java.lang.UnsatisfiedLinkError: Native method not found: cc.openframeworks.OFAndroid.init:()V
    10-06 07:00:38.649: E/AndroidRuntime(4191): 	at cc.openframeworks.OFAndroid.init(Native Method)
    10-06 07:00:38.649: E/AndroidRuntime(4191): 	at cc.openframeworks.OFAndroid$2.run(OFAndroid.java:311)
    10-06 07:00:38.649: E/AndroidRuntime(4191): 	at java.lang.Thread.run(Thread.java:841)
    10-06 07:00:38.649: W/ActivityManager(588):   Force finishing activity cc.openframeworks.androidEmptyExample/.OFActivity
    10-06 07:00:38.659: I/OF(4191): creating app directory: /storage/emulated/0/Android/data/cc.openframeworks.androidEmptyExample/files
    10-06 07:00:38.659: I/ofAppAndroidWindow(4191): setting app dir name to: "/storage/emulated/0/Android/data/cc.openframeworks.androidEmptyExample/files"
    10-06 07:00:38.659: W/ResourceType(4191): getEntry failing because entryIndex 1 is beyond type entryCount 1
    10-06 07:00:38.659: W/ResourceType(4191): Failure getting entry for 0x7f040001 (t=3 e=1) in package 0 (error -2147483647)
    10-06 07:00:38.659: E/OF(4191): error retrieving app name
    10-06 07:00:38.659: E/OF(4191): android.content.res.Resources$NotFoundException: String resource ID #0x7f040001
    10-06 07:00:38.659: E/OF(4191): 	at android.content.res.Resources.getText(Resources.java:244)
    10-06 07:00:38.659: E/OF(4191): 	at cc.openframeworks.OFAndroid$1.run(OFAndroid.java:223)
    10-06 07:00:38.659: E/OF(4191): 	at java.lang.Thread.run(Thread.java:841)
    10-06 07:00:38.759: D/dalvikvm(588): GC_FOR_ALLOC freed 911K, 17% free 26467K/31536K, paused 97ms, total 97ms
    10-06 07:00:38.859: D/dalvikvm(588): GC_FOR_ALLOC freed 391K, 17% free 26449K/31536K, paused 97ms, total 97ms
    10-06 07:00:38.879: I/OF(4191): onPause
    10-06 07:00:38.879: I/NotifUtils(14122): Notifications are disabled for this folder; not notifying
    10-06 07:00:38.919: I/Adreno-EGL(4191): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13
    10-06 07:00:38.940: E/Email(14122): Unexpected empty syncAuthority from cursor
    10-06 07:00:38.950: D/OpenGLRenderer(4191): Enabling debug mode 0
    10-06 07:00:38.960: W/HandlerScheduledExecuto(4695): Task does not implement UiTask. Consider using NamedUiRunnable for eww@42511948
    10-06 07:00:38.970: D/dalvikvm(14122): GC_CONCURRENT freed 487K, 6% free 9677K/10276K, paused 8ms+3ms, total 29ms
    10-06 07:00:39.850: D/SyncService(1247): onReceive: android.intent.action.BATTERY_CHANGED
    10-06 07:00:40.671: I/Process(4191): Sending signal. PID: 4191 SIG: 9
    10-06 07:00:40.681: W/InputMethodManagerService(588): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@427a1690 attribute=null, token = android.os.BinderProxy@429ccf48
    10-06 07:00:40.681: I/ActivityManager(588): Process cc.openframeworks.androidEmptyExample (pid 4191) has died.
    10-06 07:00:41.542: D/dalvikvm(1430): GC_CONCURRENT freed 1245K, 11% free 13514K/15124K, paused 3ms+7ms, total 55ms
    10-06 07:00:42.784: D/SyncService(1247): onReceive: android.intent.action.BATTERY_CHANGED

Ok, this was stupid, I was using the main.h file from an OSX app, not from an android app.

See this post.