Android Question CameraEx Example program crash

Sreepathy T L

Member
Licensed User
Longtime User
Hi,
I was testing the CameraEx example program
B4X:
https://www.b4x.com/android/forum/threads/class-cameraex-extends-the-camera-library-functionality.23801/#content
on my Lenovo S 660 Kitkat phone. When I pressed the autofocus button a few times, the program is crashing. Log is generated as follows:
B4X:
Logger connected to:  Lenovo Lenovo S660
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
90
[Height=480, IsInitialized=false, Width=640
]
AutoFocus error.
Error occurred on line: 316 (CameraExClass)
java.lang.RuntimeException: autoFocus failed
    at android.hardware.Camera.native_autoFocus(Native Method)
    at android.hardware.Camera.autoFocus(Camera.java:1433)
    at anywheresoftware.b4a.objects.CameraW.AutoFocus(CameraW.java:191)
    at anywheresoftware.b4a.samples.camera.cameraexclass._focusandtakepicture(cameraexclass.java:230)
    at anywheresoftware.b4a.samples.camera.main._btnfocus_click(main.java:594)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
    at android.view.View.performClick(View.java:4463)
    at android.view.View$PerformClick.run(View.java:18770)
    at android.os.Handler.handleCallback(Handler.java:808)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5333)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…