donnguyen / UIT-ANPR

ANPR system on Android Smartphone
89 stars 59 forks source link

java.lang.NullPointerException: #7

Closed achinverma closed 9 years ago

achinverma commented 9 years ago

hi, i am using this code to scan number plate but when i run this demo i got 11-07 10:46:20.159: E/AndroidRuntime(12711): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.setPreviewDisplay(android.view.SurfaceHolder)' on a null object reference 11-07 10:46:20.159: E/AndroidRuntime(12711): at vn.edu.uit.uitanpr.views.CameraPreview.surfaceCreated(CameraPreview.java:36) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.SurfaceView.updateWindow(SurfaceView.java:580) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:176) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1970) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.Choreographer.doCallbacks(Choreographer.java:580) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.Choreographer.doFrame(Choreographer.java:550) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.os.Handler.handleCallback(Handler.java:739) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.os.Handler.dispatchMessage(Handler.java:95) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.os.Looper.loop(Looper.java:135) 11-07 10:46:20.159: E/AndroidRuntime(12711): at android.app.ActivityThread.main(ActivityThread.java:5254) 11-07 10:46:20.159: E/AndroidRuntime(12711): at java.lang.reflect.Method.invoke(Native Method) 11-07 10:46:20.159: E/AndroidRuntime(12711): at java.lang.reflect.Method.invoke(Method.java:372) 11-07 10:46:20.159: E/AndroidRuntime(12711): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 11-07 10:46:20.159: E/AndroidRuntime(12711): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

i am using 4.0 android sdk and i am running it on nexus 7 with 5.0 OS