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

Plyer Native camera Shows error #812

Open
Sahil-pixel opened this issue Jul 18, 2024 · 6 comments
Open

Plyer Native camera Shows error #812

Sahil-pixel opened this issue Jul 18, 2024 · 6 comments

Comments

@Sahil-pixel
Copy link

Testing on Android 13
File "jnius/jnius_export_class.pxi", line 1163, in jnius.jnius.JavaMultipleMethod.call
07-18 19:54:04.338 28943 29039 I python : File "jnius/jnius_export_class.pxi", line 877, in jnius.jnius.JavaMethod.call
07-18 19:54:04.338 28943 29039 I python : File "jnius/jnius_export_class.pxi", line 971, in jnius.jnius.JavaMethod.call_method
07-18 19:54:04.338 28943 29039 I python : File "jnius/jnius_utils.pxi", line 79, in jnius.jnius.check_exception
07-18 19:54:04.339 28943 29039 I python : jnius.jnius.JavaException: JVM exception occurred: file://my.org.test/newfile exposed beyond app through ClipData.Item.getUri() android.os.FileUriExposedException
07-18 19:54:04.339 28943 29039 I python : Python for android ended.

@Sahil-pixel Sahil-pixel changed the title Native camera Shows error Plyer Native camera Shows error Jul 18, 2024
@Cheaterman
Copy link
Contributor

Maybe consider using Camera4Kivy?

@Sahil-pixel
Copy link
Author

Here i don't need Camera4Kivy . Native camera is enough

@Sahil-pixel
Copy link
Author

could you tell me what is the problem ?

@RobertFlatt
Copy link

I don't remember all the details, but the design of Plyer Camera uses obsolete apis on Android > 10. If you want a camera Intent, probably best not to use Plyer and to write your own.

For example Plyer uses a "file URI" https://github.com/kivy/plyer/blob/master/plyer/platforms/android/camera.py#L23 this type of URI is no longer available in the api.

The issue is as far as I remember bigger than just that example line. You could try making a local copy and replacing the file URI with a valid "content URI" to shared storage (note this does not contain a file path but contains an Android generated file reference in a database). But I seem to remember perhaps there is some other issue behind that, perhaps the details of the Intent changed?

For me looking at Plyer Camera was a long time ago in a distant galaxy so I got nothing specific to offer.

@Sahil-pixel
Copy link
Author

@RobertFlatt solved using file provider . Are you in Kivy's discord server ?

@RobertFlatt
Copy link

RobertFlatt commented Aug 3, 2024

@Sahil-pixel I'm not active in things Kivy, occasionally I drive by and look in the window.

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

3 participants