Bug? NullReferenceException in CameraEx

tigrot

Well-Known Member
Licensed User
Longtime User
Hi everybody,
I have just downloaded the new v. 3.20. I have discovered that CameraExClass crashes at once with Null Reference in Camera_ready event. The phone is the usual Basic 2.3.6 GT-S5300 I use for program testing, when a basic compatibility is needed. No preview is shown on screen.
The same program works in V. 3.00.
I include the program as a reference
 

Attachments

  • fidelity.zip
    441.3 KB · Views: 268

tigrot

Well-Known Member
Licensed User
Longtime User
Forgive me. Next I'll do better...

The trace:
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NullPointerException
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:205)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
at b4a.example.cameraexclass._camera_ready(cameraexclass.java:155)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:157)
at anywheresoftware.b4a.objects.CameraW$2$1.run(CameraW.java:139)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)


The application stopped in GetParameters instruction of Camera_ready:

r.target = cam
nativeCam = r.GetField("camera")
r.target = nativeCam
parameters = r.RunMethod("getParameters")
SetDisplayOrientation
Else
Log("success = false, " & LastException)
End If
CallSub2(target, event & "_ready", Success)

Have a nice day

Mauro
 

tigrot

Well-Known Member
Licensed User
Longtime User
I only recompiled the same source in 3.00 and the phone worked well, with no reboot. The error happened on second run of the APP while 3.00 never gave this issue. Maybe the issue is in stopping the camera...
 

tigrot

Well-Known Member
Licensed User
Longtime User
Thank you for support. I'll further investigate, if the project will go on... At present the error seems reproducible. The strange is that I have a big pjt, involving also the camera, with 3 services running and have no issue, but at this time I prefer to distribute in 3.00 format, till I'll solve this issue.
 
Top