Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeCameraNamespace.NCCameraCallbackAndroid.MediaReceiveCallback NullReferenceException #117

Open
onetech-dev opened this issue Feb 26, 2024 · 3 comments

Comments

@onetech-dev
Copy link

Hello @yasirkula

First of all, thank you for the great plugin

When using NativeCamera.Permission permission = NativeCamera.TakePicture((path) => {...}, it open the device's camera. I took the picture below:
Screenshot_20240226_145230_Camera 1

Click OK and device logs NullReferenceException. Full log: "NullReferenceException: Object reference not set to an instance of an object.
EditProfileView.b__14_0 (System.String path) (at <00000000000000000000000000000000>:0)
NativeCameraNamespace.NCCameraCallbackAndroid.MediaReceiveCallback (System.String path) (at <00000000000000000000000000000000>:0)"

Is there something missing? Tested on Android (Galaxy S22, ver 14)

Thanks in advance.

@yasirkula
Copy link
Owner

Can you put Debug.Logs to see if the returned path is null?

@onetech-dev
Copy link
Author

Hi @yasirkula

Thank you for your reply!

"path" is not null. Full log: "Image path: /data/user/0/bundleID/cache/IMG_camera.jpg". I'm using Unity 2021.3.27f1.

I'm doubting the below lines:

  • material.shader = Shader.Find("Legacy Shaders/Diffuse"); => Maybe not found.
  • material.mainTexture = texture; => Texture will be destroy after 5s, maybe null.

@yasirkula
Copy link
Owner

Thanks! I'm doubting File.Exists(path) returns false. Could you please check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants