Closed jslz closed 5 years ago
I am also having the similar issue in android devices.
Either Take photo
crashes the app or changes the context of the app to camera app and resets the navigation of the app.
apparently is an android / react-native problem that shows up in other camera related libraries as well... unclear to me if that means it is a firmware issue (and if there's any work arounds), or if it is just a common thing to get wrong at the library level.
e.g. https://github.com/ivpusic/react-native-image-crop-picker/issues/240#issuecomment-353150654
In my case, ImagePicker.launchImageLibrary
crashes the app.
Possible Solution:
There is a high chance that this is not a React Native issue, rather that of your phone(Only Android) settings. Try this:
** Description:
Happy coding
The solution above does not apply to me because I already had Don't keep activities disabled. Has anyone found any other solutions?
Hey my bad,
its react-native-camera, @joshuapinter thanks for correcting me.
@MaheshNandam No worries. I was so deep in both of these libraries, my own brain was playing tricks on me. :) Gonna delete my comment so it doesn't look like I'm talking to myself.
I'm experiencing the same issue on a Moto X4 using Android 9. I also have "don't keep activities" disabled, so I'm also looking for another solution. I experienced the same issue with react-native-image-picker and swapped to this library hoping it would fix, but it didn't.
I tried decreasing the size and quality of the image to help with memory, but that didn't produce any different results. Here are my picker settings:
const pickerOptions = {
width: 1000,
height: 750,
cropping: false,
includeBase64: false,
includeExif: false,
avoidEmptySpaceAroundImage: false,
smartAlbums: ['UserLibrary'],
compressImageMaxWidth: 500,
compressImageMaxHeight: 500,
compressImageQuality: 0.5,
mediaType: 'photo',
forceJpg: true,
cropperChooseText: 'done'
};
and my dependencies
"devDependencies": {
"@babel/preset-env": "^7.0.0-beta.51",
"babel-jest": "22.0.6",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-react-native-stage-0": "^1.0.1",
"fs-extra": "^4.0.2",
"jest": "^22.0.6",
"metro-react-native-babel-preset": "^0.49.0",
"react-test-renderer": "^16.6.0-alpha.8af6728",
"replace-in-file": "^3.4.0",
"schedule": "^0.4.0"
},
"dependencies": {
"@dicebear/avatars": "^2.0.4",
"@dicebear/avatars-identicon-sprites": "^1.0.3",
"@target-corp/react-native-svg-parser": "^1.0.6",
"babel-preset-env": "^1.7.0",
"deepmerge": "^2.1.1",
"email-validator": "^2.0.4",
"fbjs": "^0.8.17",
"group-array": "^0.3.3",
"immutability-helper": "^3.0.0",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"moment-duration-format": "^2.2.2",
"moment-round": "^1.0.1",
"moment-shortformat": "^2.1.0",
"native-base": "^2.8.1",
"prop-types": "^15.6.1",
"react": "^16.6.0-alpha.8af6728",
"react-native": "^0.57.4",
"react-native-action-button": "^2.8.5",
"react-native-animatable": "^1.3.1",
"react-native-app-intro-slider": "^1.0.1",
"react-native-app-link": "^1.0.0",
"react-native-cached-image": "^1.4.3",
"react-native-checkbox": "^2.0.0",
"react-native-code-push": "^5.4.2",
"react-native-collapsible-header": "0.0.11",
"react-native-communications": "^2.2.1",
"react-native-deck-swiper": "^1.5.17",
"react-native-emoji": "^1.3.1",
"react-native-fast-image": "^5.1.0",
"react-native-fetch-blob": "^0.10.8",
"react-native-firebase": "^4.2.0",
"react-native-gifted-chat": "^0.4.3",
"react-native-image-crop-picker": "^0.23.1",
"react-native-image-gallery": "^2.1.5",
"react-native-image-picker": "^0.28.0",
"react-native-image-progress": "^1.1.1",
"react-native-image-resizer": "^1.0.0",
"react-native-image-zoom-viewer": "^2.2.5",
"react-native-keyboard-aware-scroll-view": "^0.5.0",
"react-native-linear-gradient": "^2.4.0",
"react-native-material-textfield": "^0.12.0",
"react-native-modal": "^6.5.0",
"react-native-modal-datetime-picker": "^5.1.0",
"react-native-modal-dropdown": "^0.6.2",
"react-native-photo-grid": "0.0.2",
"react-native-pose": "^0.8.1",
"react-native-progress": "^3.5.0",
"react-native-progressive-image": "^1.0.4",
"react-native-sideswipe": "^1.4.2",
"react-native-snap-carousel": "^3.7.5",
"react-native-splash-screen": "^3.1.1",
"react-native-star-rating": "^1.1.0",
"react-native-svg": "^6.5.2",
"react-native-svg-charts": "^5.2.0",
"react-native-svg-uri": "^1.2.3",
"react-native-tag-input": "0.0.18",
"react-native-testfairy": "^2.11.0",
"react-native-text": "0.0.7",
"react-native-textinput-effects": "^0.4.2",
"react-native-version-check": "^3.0.3",
"react-navigation": "^2.11.2",
"react-navigation-material-bottom-tabs": "^0.3.0",
"react-navigation-redux-helpers": "^1.1.2",
"react-redux": "^5.0.7",
"react-redux-firebase": "^2.1.5",
"recompose": "^0.30.0",
"redux": "^3.7.2",
"redux-firestore": "^0.5.7",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"reselect": "^3.0.1",
"tcomb": "^3.2.27",
"tcomb-form-native": "^0.6.13",
"url-parse": "^1.4.4"
}
Thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.
Why this community always closed every open bug that was not discussed for a month or two? Even there is no correct answers marked in the bug. Not a single one.
You can close the bug by mentioning or relating to some other open bugs.
is there any solution for this issue? in my case camera opens by ImagePicker.launchCamera
and taking images such as darken view by cover camera or changing focus or switching camera to back or front. then once click on capture app getting crashed and opens splash screen.
RN version 0.60
issue exist in upto android API level 20
@russelRajitha there may be one possible issue that you are using code push in you app as the same behaviour I was facing. check and do some changes if your app really using code push.
@saadmutahar ,i couldnt find any solution, i checked logcat and these logs on click capture button.
2019-10-02 15:27:05.300 5611-5688/? E: e = /sys/class/input_booster/touchkey/time (Permission denied)
2019-10-02 15:27:05.301 5611-5688/? E: e = /sys/class/input_booster/touchkey/time (Permission denied)
2019-10-02 15:27:05.306 5611-5688/? E: e = /sys/class/input_booster/touchkey/time (Permission denied)
2019-10-02 15:27:06.285 3619-5553/? E: [com.sec.android.app.camera/com.sec.android.app.camera.Camera[23727]#0] disconnect: not connected (req=1)
2019-10-02 15:27:06.291 4040-6346/? E: win=Window{62ca5bf u0 com.sec.android.app.camera/com.sec.android.app.camera.Camera} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=8 caller=com.android.server.wm.WindowManagerService.tryStartExitingAnimation:2759 com.android.server.wm.WindowManagerService.relayoutWindow:2456 com.android.server.wm.Session.relayoutForTranslate:302 android.view.IWindowSession$Stub.onTransact:518 com.android.server.wm.Session.onTransact:186 android.os.Binder.execTransact:739 <bottom of call stack>
2019-10-02 15:27:06.601 23727-23727/? E: onStop : java.util.NoSuchElementException
2019-10-02 15:27:06.649 3619-3676/? E: [com.sec.android.app.camera/com.sec.android.app.camera.AttachActivity[23727]#0] disconnect: not connected (req=1)
2019-10-02 15:27:06.655 4040-6346/? E: win=Window{d10b9e4 u0 com.sec.android.app.camera/com.sec.android.app.camera.AttachActivity} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=8 caller=com.android.server.wm.WindowManagerService.tryStartExitingAnimation:2759 com.android.server.wm.WindowManagerService.relayoutWindow:2456 com.android.server.wm.Session.relayoutForTranslate:302 android.view.IWindowSession$Stub.onTransact:518 com.android.server.wm.Session.onTransact:186 android.os.Binder.execTransact:739 <bottom of call stack>
2019-10-02 15:27:07.469 4040-4447/? E: !@Sync 9325 [2019-10-02 15:27:07.469] FD count : 687
2019-10-02 15:27:13.216 3619-4189/? E: [com.myAppName/com.myAppName.MainActivity[3878]#1] disconnect: not connected (req=1)
2019-10-02 15:27:13.500 3878-3878/com.myAppName E: sendUserActionEvent() returned.
anyone have any idea? i have stuck in this for hours.
Same here, this issue still occurs on low device android
@russelRajitha have you found any solution? The same is happening here and I can´t figure out the reason
@pedro Same here, library works just fine, but opening the camera, sometimes goes, and otehr times crashes the app
is there any solution for this issue? in my case camera opens by
ImagePicker.launchCamera
and taking images such as darken view by cover camera or changing focus or switching camera to back or front. then once click on capture app getting crashed and opens splash screen. RN version 0.60 issue exist in upto android API level 20
Did you found any solution? Facing the same issue here, lounch camera and clic some option makes my app crash. Just taking the photo does not
This is the same issue as linked in Expo SDK : https://github.com/expo/expo/issues/7946
I am getting this issue only in Redmi devices. Does anyone have any leads on this issue?
This solution helps with some cases:
first make sure you have your permissions. Use this library
import Permissions from 'react-native-permissions';
to use launchCamera add:
Permissions.PERMISSIONS.ANDROID.CAMERA
if you want to use the option to saveToPhotos
include
Permissions.PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE
when developing make sure you check your apps settings to see if camera and storage are allowed by your app. if they are not make sure to disable the button so it doesn't call the launchCamera function or else it will crash.
Don't forget to include these permissions is android manifest if this still does not work for you:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Note this may be a partial solution. because saveToPhotos = true for my options doesn't work for me. I came here for help. I have to learn more about the WRITE_EXTERNAL_STORAGE permission
On (only) some Android devices (e.g. Moto E 2015 running 5.1.1, Moto G2 running 6.0) using "Take Photo..." will lead to a crash, whereas "Choose from Library..." works fine.
How to repeat issue and example
can't show the whole app but
Solution
(Avoid tickling whatever is bad in the device specific Android implementation?)
Additional Information