question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application restarts on Android

See original GitHub issue

Application 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yasirkulacommented, Feb 4, 2020

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/

0reactions
adityathoutamcommented, Feb 5, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I programmatically "restart" an Android app?
My best way to restart application is to use finishAffinity(); Since, finishAffinity(); can be used on JELLY BEAN versions only, so we can...
Read more >
Fix an Android device that's restarting or crashing
Step 3: Restart your phone normally & check apps​​ Restart your phone. One by one, remove recently downloaded apps. Learn how to delete...
Read more >
Why do my Android apps restart all over again if I minimize ...
Software Issues: Sometimes, the phone's software can cause apps to crash or make the phone restart. This could be due to a software...
Read more >
Does Your Android Phone Keep Restarting? 7 Ways to Fix It
1. Update the Android Operating System · 2. Update Your Apps · 3. Enable Safe Mode and Remove Apps · 4. Clear Out...
Read more >
Why do android apps restart when switching?
Android apps restart when switching because the Android operating system is designed to keep apps running in the background.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found