Application restarts on Android
See original GitHub issueApplication restarts on certain Android devices, when using this function
private void TakePictureAfterPermissions(Texture2D monumentFilterLogo)
{
NativeCamera.TakePicture(path =>
{
if (path != null)
{
var Texture = NativeCamera.LoadImageAtPath(path, maxSize, false);
if (Texture != null)
{
// Applying Texture to RawImage
}
}
}, maxSize, true, NativeCamera.PreferredCamera.Front);
}
Here is the logcat generated
2020-02-03 12:04:08.465 24039-24196/? E/ImageUtils: decodeOrientation() - Fail to access file /devroot/data/data/APP_PACKAGE_NAME/cache/IMG_camera.jpg java.io.FileNotFoundException: /devroot/data/data/APP_PACKAGE_NAME/cache/IMG_camera.jpg: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileInputStream.<init>(FileInputStream.java:159) at java.io.FileInputStream.<init>(FileInputStream.java:115) at com.oneplus.media.ImageUtils.decodeOrientation(ImageUtils.java:1667) at com.oneplus.camera.io.PhotoSaveTask.onPrepareMediaStoreValues(PhotoSaveTask.java:567) at com.oneplus.camera.io.MediaSaveTask.insertToMediaStore(MediaSaveTask.java:260) at com.oneplus.camera.io.PhotoSaveTask.insertToMediaStore(PhotoSaveTask.java:367) at com.oneplus.camera.io.FileManagerImpl$FileManageerThread$1.handleMessage(FileManagerImpl.java:515) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7581) at libcore.io.IoBridge.open(IoBridge.java:482) at java.io.FileInputStream.<init>(FileInputStream.java:159) at java.io.FileInputStream.<init>(FileInputStream.java:115) at com.oneplus.media.ImageUtils.decodeOrientation(ImageUtils.java:1667) at com.oneplus.camera.io.PhotoSaveTask.onPrepareMediaStoreValues(PhotoSaveTask.java:567) at com.oneplus.camera.io.MediaSaveTask.insertToMediaStore(MediaSaveTask.java:260) at com.oneplus.camera.io.PhotoSaveTask.insertToMediaStore(PhotoSaveTask.java:367) at com.oneplus.camera.io.FileManagerImpl$FileManageerThread$1.handleMessage(FileManagerImpl.java:515) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:67)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Thank you for all the feedback. At this point, I can’t really tell why this is happening. Seeing
/devroot/
, I’m guessing that the device is rooted. Perhaps this is an issue on OnePlus’s side that got fixed in later updates but because the device is rooted, it didn’t receive these updates (some search results for “oneplus android save to gallery crash” say that certain crashes are fixed after updating the OS).Might be related: https://forums.oneplus.com/threads/the-camera-crash-app-with-android-10-3.1174247/
The device is Oneplus 7 Pro. And it is not rooted and is on latest OTA build. Anyway I’ll try it in other devices and re-open this issue, if I encounter it. Thank you for your prompt response.