[Glass Development] dq11:
voiceexample compiled but fails to launch due to permission denial. what am i doing wrong?

package:/data/app/com.openquartz.voiceexample-1.apk=com.openquartz.voiceexample

adb shell am start -a android.intent.action.MAIN -n com.openquartz.voiceexample/.MenuActivity

Starting: Intent { act=android.intent.action.MAIN cmp=com.openquartz.voiceexample/.MenuActivity }

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.openquartz.voiceexample/.MenuActivity } from null (pid=19725, uid=2000) not exported from uid 10031

at android.os.Parcel.readException(Parcel.java:1327)

at android.os.Parcel.readException(Parcel.java:1281)

at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1631)

at com.android.commands.am.Am.runStart(Am.java:441)

at com.android.commands.am.Am.run(Am.java:108)

at com.android.commands.am.Am.main(Am.java:81)

at com.android.internal.os.RuntimeInit.finishInit(Native Method)

at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:238)

at dalvik.system.NativeStart.main(Native Method)

---------- Post added at 06:30 AM ---------- Previous post was at 06:23 AM ----------

Never mind. voice example is launched using "ok glass voice example" and not using adb

---------- Post added at 07:18 AM ---------- Previous post was at 06:30 AM ----------

@jarredburrows

can you explain how to launch the facedetect app? is it self contained or does it additionally rely on the camera and glasspreview example-apps?

I am using xe12 and opencv2.4.7.1 . Below is the adblogcat of FdActivity and it forcestops saying unable to open camera

I/ActivityManager( 204): START {cmp=com.jtxdriggers.android.glass.glasslauncher/.MenuActivity} from pid -1

W/ActivityManager( 204): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.jtxdriggers.android.glass.glasslauncher/.MenuActivity }

I/MainTimelineActivity( 482): onPause: 41700020

I/MainTimelineActivity( 482): Removing listener from VoiceService: MainTimelineActivity

D/audio_hw_primary( 109): select_output_device: output_type: 1, base_headset_volume: 1

D/SliderMenuPresenter(13965): Initialize a new menu view : 4

D/CardScrollView(13965): Activating.

D/SliderSubMenuProvider(13965): Open top-level menu

W/Resources( 204): Converting to boolean: TypedValue{t=0x3/d=0xc4b "res/anim/accelerate_interpolator.xml" a=1 r=0x10a0005}

W/Resources( 204): Converting to boolean: TypedValue{t=0x3/d=0xc4b "res/anim/accelerate_interpolator.xml" a=1 r=0x10a0005}

I/ActivityManager( 204): Displayed com.jtxdriggers.android.glass.glasslauncher/.MenuActivity: +410ms (total +1m31s867ms)

I/ActivityManager( 204): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.openquartz.facedetect/.FdActivity} from pid 13965

D/SliderMenuView(13965): Performed action on 0 : true

I/ActivityManager( 204): Start proc com.openquartz.facedetect for activity com.openquartz.facedetect/.FdActivity: pid=7176 uid=10033 gids={1006}

I/MainTimelineActivity( 482): onStop: 41700020

D/OpenGLRenderer( 482): Flushing caches (mode 0)

D/dalvikvm( 204): GC_CONCURRENT freed 728K, 10% free 12855K/14151K, paused 7ms+21ms

D/OpenGLRenderer(13965): Flushing caches (mode 0)

D/OpenGLRenderer( 482): Flushing caches (mode 1)

I/OCVSample::Activity( 7176): Instantiated new class com.openquartz.facedetect.FdActivity

I/OCVSample::Activity( 7176): called onCreate

D/CameraBridge( 7176): Attr count: 5

D/OpenCV/StaticHelper( 7176): Trying to get library list

E/OpenCV/StaticHelper( 7176): OpenCV error: Cannot load info library for OpenCV

D/OpenCV/StaticHelper( 7176): Library list: ""

D/OpenCV/StaticHelper( 7176): First attempt to load libs

D/OpenCV/StaticHelper( 7176): Trying to init OpenCV libs

D/OpenCV/StaticHelper( 7176): Trying to load library opencv_java

D/dalvikvm( 7176): Trying to load lib /data/data/com.openquartz.facedetect/lib/libopencv_java.so 0x4168bc88

D/dalvikvm( 7176): Added shared lib /data/data/com.openquartz.facedetect/lib/libopencv_java.so 0x4168bc88

D/OpenCV/StaticHelper( 7176): OpenCV libs init was ok!

D/OpenCV/StaticHelper( 7176): First attempt to load libs is OK

I/OpenCV/StaticHelper( 7176): General configuration for OpenCV 2.4.7.1 =====================================

I/OpenCV/StaticHelper( 7176): Version control: 2.4.7.1-dirty

I/OpenCV/StaticHelper( 7176): Platform:

I/OpenCV/StaticHelper( 7176): Host: Linux 3.2.0-56-generic x86_64

I/OpenCV/StaticHelper( 7176): Target: Linux 1 armv7-a

I/OpenCV/StaticHelper( 7176): CMake: 2.8.12

I/OpenCV/StaticHelper( 7176): CMake generator: Ninja

I/OpenCV/StaticHelper( 7176): CMake build tool: /usr/local/bin/ninja

I/OpenCV/StaticHelper( 7176): Configuration: Release

I/OpenCV/StaticHelper( 7176): C/C++:

I/OpenCV/StaticHelper( 7176): Built as dynamic libs?: NO

I/OpenCV/StaticHelper( 7176): C++ Compiler: /opt/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ (ver 4.6)

I/OpenCV/StaticHelper( 7176): C++ flags (Release): -fexceptions -frtti -Wno-psabi --sysroot=/opt/android-ndk-r8c/platforms/android-8/arch-arm -fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -fdiagnostics-show-option -fomit-frame-pointer -mthumb -fomit-frame-pointer -fno-strict-aliasing -O3 -DNDEBUG -DNDEBUG

I/OpenCV/StaticHelper( 7176): C++ flags (Debug): -fexceptions -frtti -Wno-psabi --sysroot=/opt/android-ndk-r8c/platforms/android-8/arch-arm -fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -fdiagnostics-show-option -fomit-frame-pointer -marm -fno-omit-frame-pointer -fno-strict-aliasing -O0 -g -DDEBUG -D_DEBUG -O0 -DDEBUG -D_DEBUG

I/OpenCV/StaticHelper( 7176): C Compiler: /opt/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc

I/OpenCV/StaticHelper( 7176): C flags (Release): -fexceptions -Wno-psabi --sysroot=/opt/android-ndk-r8c/platforms/android-8/arch-arm -fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -fomit-frame-pointer -mthumb -fomit-frame-pointer -fno-strict-aliasing -O3 -DNDEBUG -DNDEBUG

I/OpenCV/StaticHelper( 7176): C flags (Debug): -fexceptions -Wno-psabi --sysroot=/opt/android-ndk-r8c/platforms/android-8/arch-arm -fpic -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -fomit-frame-pointer -marm -fno-omit-frame-pointer -fno-strict-aliasing -O0 -g -DDEBUG -D_DEBUG -O0 -DDEBUG -D_DEBUG

I/OpenCV/StaticHelper( 7176): Linker flags (Release): -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now

I/OpenCV/StaticHelper( 7176): Linker flags (Debug): -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now

I/OpenCV/StaticHelper( 7176): Precompiled headers: YES

I/OpenCV/StaticHelper( 7176): OpenCV modules:

I/OpenCV/StaticHelper( 7176): To be built: core androidcamera flann imgproc highgui features2d calib3d ml objdetect video contrib photo java legacy ocl stitching ts videostab

I/OpenCV/StaticHelper( 7176): Disabled: gpu world

I/OpenCV/StaticHelper( 7176): Disabled by dependency: -

I/OpenCV/StaticHelper( 7176): Unavailable: nonfree python superres

I/OpenCV/StaticHelper( 7176): Android:

I/OpenCV/StaticHelper( 7176): Android ABI: armeabi-v7a

I/OpenCV/StaticHelper( 7176): STL type: gnustl_static

I/OpenCV/StaticHelper( 7176): Native API level: android-8

I/OpenCV/StaticHelper( 7176): SDK target: android-11

I/OpenCV/StaticHelper( 7176): Android NDK: /opt/android-ndk-r8c (toolchain: arm-linux-androideabi-4.6)

I/OpenCV/StaticHelper( 7176): android tool: /opt/android-sdk-linux/tools/android (Android SDK Tools, revision 22.)

I/OpenCV/StaticHelper( 7176): Google Play package: YES

I/OpenCV/StaticHelper( 7176): Android examples: YES

I/OpenCV/StaticHelper( 7176): GUI:

I/OpenCV/StaticHelper( 7176): GTK+ 2.x: NO

I/OpenCV/StaticHelper( 7176): GThread : NO

I/OpenCV/StaticHelper( 7176): GtkGlExt: NO

I/OpenCV/StaticHelper( 7176): OpenGL support: NO

I/OpenCV/StaticHelper( 7176): Media I/O:

I/OpenCV/StaticHelper( 7176): ZLib: z (ver 1.2.3)

I/OpenCV/StaticHelper( 7176): JPEG: build (ver 62)

I/OpenCV/StaticHelper( 7176): PNG: build (ver 1.5.12)

I/OpenCV/StaticHelper( 7176): TIFF: build (ver 42 - 4.0.2)

I/OpenCV/StaticHelper( 7176): JPEG 2000: build (ver 1.900.1)

I/OpenCV/StaticHelper( 7176): OpenEXR: build (ver 1.7.1)

I/OpenCV/StaticHelper( 7176): Video I/O:

I/OpenCV/StaticHelper( 7176): AndroidNativeCamera: YES, use prebuilt libraries

I/OpenCV/StaticHelper( 7176): Other third-party libraries:

I/OpenCV/StaticHelper( 7176): Use IPP: NO

I/OpenCV/StaticHelper( 7176): Use Eigen: YES (ver 3.1.2)

I/OpenCV/StaticHelper( 7176): Use TBB: YES (ver 4.1 interface 6102)

I/OpenCV/StaticHelper( 7176): Use OpenMP: NO

I/OpenCV/StaticHelper( 7176): Use GCD NO

I/OpenCV/StaticHelper( 7176): Use Concurrency NO

I/OpenCV/StaticHelper( 7176): Use C=: NO

I/OpenCV/StaticHelper( 7176): Use Cuda: NO

I/OpenCV/StaticHelper( 7176): Use OpenCL: YES

I/OpenCV/StaticHelper( 7176): OpenCL:

I/OpenCV/StaticHelper( 7176): Version: dynamic

I/OpenCV/StaticHelper( 7176): Include path: /home/reports/ci/slave_desktop/50-SDK/opencv/3rdparty/include/opencl/1.2

I/OpenCV/StaticHelper( 7176): Use AMD FFT: NO

I/OpenCV/StaticHelper( 7176): Use AMD BLAS: NO

I/OpenCV/StaticHelper( 7176): Python:

I/OpenCV/StaticHelper( 7176): Interpreter: /usr/bin/python2 (ver 2.7.3)

I/OpenCV/StaticHelper( 7176): Java:

I/OpenCV/StaticHelper( 7176): ant: /usr/bin/ant (ver 1.8.2)

I/OpenCV/StaticHelper( 7176): Java tests: NO

I/OpenCV/StaticHelper( 7176): Documentation:

I/OpenCV/StaticHelper( 7176): Build Documentation: YES

I/OpenCV/StaticHelper( 7176): Sphinx: /usr/local/bin/sphinx-build (ver 1.1.3)

I/OpenCV/StaticHelper( 7176): PdfLaTeX compiler: /usr/bin/pdflatex

I/OpenCV/StaticHelper( 7176): Tests and samples:

I/OpenCV/StaticHelper( 7176): Tests: NO

I/OpenCV/StaticHelper( 7176): Performance tests: NO

I/OpenCV/StaticHelper( 7176): C/C++ Examples: NO

I/OpenCV/StaticHelper( 7176): Install path: /home/reports/ci/slave_desktop/50-SDK/build/builds/o4a/install

I/OpenCV/StaticHelper( 7176): cvconfig.h is in: /home/reports/ci/slave_desktop/50-SDK/build/builds/o4a

I/OpenCV/StaticHelper( 7176): -----------------------------------------------------------------

I/OCVSample::Activity( 7176): OpenCV loaded successfully

I/OCVSample::Activity( 7176): Loaded cascade classifier from /data/data/com.openquartz.facedetect/app_cascade/haarcascade_frontalface_alt.xml

D/libEGL ( 7176): loaded /system/lib/egl/libGLES_android.so

D/libEGL ( 7176): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so

D/libEGL ( 7176): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so

D/libEGL ( 7176): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so

D/OpenGLRenderer( 7176): Enabling debug mode 0

D/CameraBridge( 7176): call surfaceChanged event

D/JavaCameraView( 7176): Connecting to camera

D/JavaCameraView( 7176): Initialize java camera

D/JavaCameraView( 7176): Trying to open camera with old open()

W/CameraService( 109): CameraService::connect X (pid 7176) rejected (existing client).

E/JavaCameraView( 7176): Camera is not available (in use or does not exist): Fail to connect to camera service

D/JavaCameraView( 7176): Trying to open camera with new open(0)

W/CameraService( 109): CameraService::connect X (pid 7176) rejected (existing client).

E/JavaCameraView( 7176): Camera #0failed to open: Fail to connect to camera service

D/AndroidRuntime( 7176): Shutting down VM

W/dalvikvm( 7176): threadid=1: thread exiting with uncaught exception (group=0x40daf1f8)

E/AndroidRuntime( 7176): FATAL EXCEPTION: main

E/AndroidRuntime( 7176): java.lang.NullPointerException

E/AndroidRuntime( 7176):	at com.openquartz.facedetect.JView.initializeCamera(JView.java:24)

E/AndroidRuntime( 7176):	at org.opencv.android.JavaCameraView.connectCamera(JavaCameraView.java:239)

E/AndroidRuntime( 7176):	at org.opencv.android.CameraBridgeViewBase.onEnterStartedState(CameraBridgeViewBase.java:355)

E/AndroidRuntime( 7176):	at org.opencv.android.CameraBridgeViewBase.processEnterState(CameraBridgeViewBase.java:318)

E/AndroidRuntime( 7176):	at org.opencv.android.CameraBridgeViewBase.checkCurrentState(CameraBridgeViewBase.java:311)

E/AndroidRuntime( 7176):	at org.opencv.android.CameraBridgeViewBase.surfaceChanged(CameraBridgeViewBase.java:197)

E/AndroidRuntime( 7176):	at android.view.SurfaceView.updateWindow(SurfaceView.java:555)

E/AndroidRuntime( 7176):	at android.view.SurfaceView.access$000(SurfaceView.java:82)

E/AndroidRuntime( 7176):	at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:170)

E/AndroidRuntime( 7176):	at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)

E/AndroidRuntime( 7176):	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1626)

E/AndroidRuntime( 7176):	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2451)

E/AndroidRuntime( 7176):	at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime( 7176):	at android.os.Looper.loop(Looper.java:137)

E/AndroidRuntime( 7176):	at android.app.ActivityThread.main(ActivityThread.java:4424)

E/AndroidRuntime( 7176):	at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 7176):	at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime( 7176):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

E/AndroidRuntime( 7176):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

E/AndroidRuntime( 7176):	at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager( 204): Force finishing activity com.openquartz.facedetect/.FdActivity

W/ActivityManager( 204): Activity pause timeout for ActivityRecord{418e2250 com.openquartz.facedetect/.FdActivity}

I/MainTimelineActivity( 482): onStart: 41700020