Android Question CameraEx Android Version "8.1" Application Crash

Ertan

Active Member
Licensed User

Hello there,

In Erel's Camera example, I discovered a problem with the Camera example. Maybe it's a common problem, but I haven't found the necessary solution yet.

You can reveal this problem as follows.

If you upload the APK of the project at https://appetize.io/ and select "Android 8.1" and Confirm Camera Permission after opening the application, the application crashes. I could not do this on my local phones. I could not make this mistake.

But users get this error in my application on Google Play.


cameraexclass._camera_ready


B4X:
java.lang.NullPointerException:
  at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod (Reflection.java:205)
  at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod (Reflection.java:802)
  at **.cameraexclass._camera_ready (cameraexclass.java:117)
  at java.lang.reflect.Method.invoke (Native Method)
  at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:213)
  at anywheresoftware.b4a.BA.raiseEvent (BA.java:193)
  at anywheresoftware.b4a.objects.CameraW$2$1.run (CameraW.java:139)
  at android.os.Handler.handleCallback (Handler.java:888)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:213)
  at android.app.ActivityThread.main (ActivityThread.java:8178)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1101)

My library is up to date.

CameraExClass = version 1.30
Camera = version 2.20

The codes are the same in my own project.

I would be glad if you could help.
 

Attachments

  • Camera.zip
    13.2 KB · Views: 192
Last edited:

Ertan

Active Member
Licensed User
The appetize service is not really relevant in this case. You need to test on real hardware.

Implement crashlytics. You will get more information.
Hello erel,
I did what they said.

Detailed error like this.

The application is asking for permission. After giving permission, the application crashes. This error varies from device to device. While it happens on one device, it doesn't happen on the other device.

I would be glad if you help me. Thank you so much.
B4X:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
       at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:205)
       at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod(Reflection.java:802)
       at packetname.cameraexclass._camera_ready(cameraexclass.java:119)
       at java.lang.reflect.Method.invoke(Method.java)
       at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
       at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
       at anywheresoftware.b4a.objects.CameraW$2$1.run(CameraW.java:139)
       at android.os.Handler.handleCallback(Handler.java:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Screenshot_57.png


Screenshot_58.png
 
Upvote 0

Ertan

Active Member
Licensed User
You are testing the camera on virtual devices. Why????????????


You are right . I tested it on the virtual device in the first post. These are the errors that appear in the Google Console, and these are real devices.
Screenshot_60.png


2nd)

Screenshot_62.png

I'm viewing these incoming alerts on the Google Play Console. I think of them as real users. I did not encounter this problem on real phones, but the errors seem the same as in my Google Play Console reports.

It happened 8 days ago and these are real devices. (if not google's bots)

The reason I tested this on the virtual device is;

There is NO DIFFERENCE BETWEEN ERROR LOGS between Real device and Virtual device.[/QUOTE]
 
Last edited:
Upvote 0
Top