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.

App restarts after taking a picture. Google Pixel Android 7.1.1

See original GitHub issue

Works fine on Moto 3, Lenovo K5 Plus running Android 5.1.1.

However, after taking a photo on Google Pixel 7.1.1, the app restarts. Choosing image from photo library works fine though. My Options:

var options = {
  title: 'Select meal image',
  storageOptions: {
    skipBackup: true,
    path: 'images'
  },
  quality: 0.6,
  mediaType: 'photo',
  maxHeight: 2000,
  maxWidth: 1000
};
    getBreakfastImage() {
        this.setState({
            breakfastLogged: true,
        });
        ImagePicker.showImagePicker(options, (response) => {
            if (response.didCancel) {
            }
            else if (response.error) {
            }
            else if (response.customButton) {
            }
            else {
                let source = { uri: response.uri };
                this.setState({
                    breakfastImageCount: this.state.breakfastImageCount+1,
                    imageCountStatic: this.state.imageCountStatic+1
                });
                breakfastImages.push({
                    key: this.state.breakfastImageCount,
                    imageSource: source,
                    imageID: null
                });
                breakfastImages64.push(
                    response.data
                );
                this.setState({ reRender: Math.random() });
            }
        });
    }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:33 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
spidergearscommented, May 12, 2017

@haitaoli I have the same issue, running Android Marshmallow on Moto G2. App restarts with splash screen. Since the components are reinitialised, I lose the captured images reference, the image remains saved in phone gallery applications.

Works fine when choosing image from gallery.

"react": "16.0.0-alpha.6",
"react-native": "0.43.3",
"react-native-image-picker": "^0.26.3",

Went though other similar issues, couldn’t find anything that helps.

3reactions
AnurajDevcommented, Jul 11, 2019

The issue got fixed when I changed the version in the package.json from “react-native-image-picker”: “^0.28.0 to “react-native-image-picker”: “0.28.0 and did an npm install.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App restarts after taking a picture. Google Pixel Android 7.1.1
Works fine on Moto 3, Lenovo K5 Plus running Android 5.1.1. However, after taking a photo on Google Pixel 7.1.1, the app restarts....
Read more >
Fix a Pixel phone that's restarting or crashing - Google Support
Try the following steps if your phone has any of these problems: Randomly reboots or restarts; Shuts down without restarting; Restarts constantly: Go...
Read more >
Random reboot - any Pixel 6 (non pro) users affected?
When I was configuring telegram, the app crashed and then the screen got black. After a minute it rebooted to the Google logo...
Read more >
Why Does Android Randomly Restart? - Technipages
In most cases, random restarts are caused by a poor quality app. Try uninstalling apps you don't use. Be sure the apps you...
Read more >
[SOLVED] Camera plugin restart App on Android - Ionic Forum
Following this Android 7.1 (Google Pixel) Camera plugin broken? topic ... the camera lag and even restart the app after having take a...
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