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 crashes frequently - java.lang.IllegalStateException: Fragment CameraActivity{474e0e8} not attached to Activity

See original GitHub issue

Hi… I need some help.

My app crashes frequently…

Exception java.lang.IllegalStateException: Fragment CameraActivity{474e0e8} not attached to Activity

It’s Android, all versions, multiple models. Usually I get it on app startup, but sometimes later…

Functions: ` grantPermission: function(node) { cordova.plugins.diagnostic.requestCameraAuthorization({ successCallback: function(status){ console.log("Authorization request for camera use was " + (status == cordova.plugins.diagnostic.permissionStatus.GRANTED ? “granted” : “denied”)); Photocamera.permissionGranted = true; Photocamera.startCamera(node); //TriggerEvent(‘cameraOnOff’,{type:‘on’}); }, errorCallback: function(error){ console.error(error); }, externalStorage: false }); },

startCamera: function(node) {
	if (this.permissionGranted == true) {
		CameraPreview.startCamera({x: 0, y: document.getElementById(node).clientHeight - window.screen.width, width: window.screen.width, height: window.screen.height, camera: CameraPreview.CAMERA_DIRECTION.BACK, toBack: true, previewDrag: false, tapPhoto: false});
		CameraPreview.show();
	}
},

takePicture: function() {
	CameraPreview.takePicture({quality: 85}, function(base64PictureData){
		imageSrcData = 'data:image/jpeg;base64,' +base64PictureData;
		PhotoView.showPhotoView(imageSrcData);
		CameraPreview.stopCamera();
	});
	TriggerEvent('showLoader');
},

`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
csabagasparikcommented, Dec 21, 2018

not yet. I will apply today v0.10.0, will keep you updated.

0reactions
maxborgatticommented, Dec 21, 2018

no updates here, 42 hits this week on our main app (~150000 Android users)

does anyone has a feedback on this using v0.10.0?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.IllegalStateException: Fragment not attached to Activity
This error happens due to the combined effect of two factors: The HTTP request, when complete, invokes either onResponse() or onError() (which work...
Read more >
Android Fragment not attached to a context | by Weidian Huang
This is a common issue if we don't take care of it in our application, and it is difficult to catch the issue...
Read more >
java.lang.IllegalStateException: Fragment not attached to Activity
Android : java. lang. IllegalStateException : Fragment not attached to Activity [ Beautify Your Computer ...
Read more >
The setUserVisibleHint() is crashing with Fragment not ...
0) is crashing with a "Fragment not attached to Activity". I tested on API levels 16 and 23. @Override public void setUserVisibleHint(boolean isVisibleToUser)...
Read more >
1039471 - crash in java.lang.IllegalStateException: Fragment ...
lang.IllegalStateException: Fragment RecentTabsPanel{422715c0} not attached to Activity at android.support.v4.app.Fragment.getLoaderManager(Fragment.java).
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