[Resolved] App crush and reloaded, detect why.


#1

I have an app which is works great on expo.
The problem is the when I try to run in as standalone app it crushes and reload.
A. About the crush itself, I suspect that it related to permission - due the app crushes when I try to use saveToCameraRoll.

In the main component’s componentDidMount I’m asking for permission of the camera

const { status: cameraStatus } = await Permissions.askAsync(Permissions.CAMERA);

and in the app.json I have "permissions": [ "CAMERA", "WRITE_EXTERNAL_STORAGE"]. Is there anything I missing here?

B. I’m wrapping all of my methods, including the one who call saveToCameraRoll with try / catch and I post a log in each catch but this log never sent. How can I know what cause the error which crushing my app.

Thanks!


#2

Hi @moshfeu - have you tried adding "READ_EXTERNAL_STORAGE" to the permissions in your app.json?


#3

@esamelson thanks for the reply. Yes. Same result. And why it needed?


#4

Turns out that the missing point was to ask permission for cameraRoll in componentDidMount which is so make sense, so, shame on me :neutral_face:

const { status: cameraRollStatus } = await Permissions.askAsync(Permissions.CAMERA_ROLL);

closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.