Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 7 crashes when picking #131

Closed
superandrew213 opened this issue Nov 9, 2016 · 9 comments
Closed

Android 7 crashes when picking #131

superandrew213 opened this issue Nov 9, 2016 · 9 comments

Comments

@superandrew213
Copy link
Contributor

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.10.2
  • react-native v0.34.1

Platform

Tell us to which platform this issue is related

  • Android 7

Expected behaviour

Open image picker

Actual behaviour

App crashes

Steps to reproduce

  1. Open image picker

Attachments

java.lang.RuntimeException: Unable to pause activity {com.xxx/com.xxx.MainActivity}: android.os.NetworkOnMainThreadException

@ivpusic
Copy link
Owner

ivpusic commented Nov 9, 2016

Hey, couly you try version 0.10.1? Also would be great if you can provide full stacktrace

@superandrew213
Copy link
Contributor Author

superandrew213 commented Nov 9, 2016

Same thing happens with 0.10.1

11-09 17:47:35.554  1228  1252 D AudioFlinger: mixer(0xed083c80) throttle end: throttle time(11)
11-09 17:47:35.554  3706  3742 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
11-09 17:47:35.554  3706  3742 W ViewRootImpl[MainActivity]: Dropping event due to root view being removed: MotionEvent { action=ACTION_HOVER_ENTER, actionButton=0, id[0]=0, x[0]=282.25415, y[0]=299.2578, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=590501, downTime=590399, deviceId=0, source=0x1002 }
11-09 17:47:35.554  3706  3742 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
11-09 17:47:35.554  3706  3742 W ViewRootImpl[MainActivity]: Dropping event due to root view being removed: MotionEvent { action=ACTION_HOVER_ENTER, actionButton=0, id[0]=0, x[0]=282.25415, y[0]=299.2578, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=590501, downTime=590399, deviceId=0, source=0x1002 }
11-09 17:47:35.555  3706  3742 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
11-09 17:47:35.555  3706  3742 W ViewRootImpl[MainActivity]: Dropping event due to root view being removed: MotionEvent { action=ACTION_HOVER_MOVE, actionButton=0, id[0]=0, x[0]=282.25415, y[0]=299.2578, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=590501, downTime=590399, deviceId=0, source=0x1002 }
11-09 17:47:35.555  3706  3742 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
11-09 17:47:35.562  1488  2316 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@a70b63e attribute=null, token = android.os.BinderProxy@3709151
11-09 17:47:35.564  1488  2065 I ActivityManager: START u0 {act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras)} from uid 10066 on display 0
11-09 17:47:35.575  3706  3706 D AndroidRuntime: Shutting down VM
11-09 17:47:35.576  3706  3706 E AndroidRuntime: FATAL EXCEPTION: main
11-09 17:47:35.576  3706  3706 E AndroidRuntime: Process: com.xxx, PID: 3706
11-09 17:47:35.576  3706  3706 E AndroidRuntime: java.lang.RuntimeException: Unable to pause activity {com.xxx/com.xxx.MainActivity}: android.os.NetworkOnMainThreadException
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:3722)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3688)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3662)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3636)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.-wrap16(ActivityThread.java)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1472)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6077)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
11-09 17:47:35.576  3706  3706 E AndroidRuntime: Caused by: android.os.NetworkOnMainThreadException
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at java.net.SocketOutputStream.write(SocketOutputStream.java:157)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at okio.Okio$1.write(Okio.java:78)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at okio.AsyncTimeout$1.write(AsyncTimeout.java:180)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at okio.RealBufferedSink.emit(RealBufferedSink.java:178)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at okhttp3.internal.ws.WebSocketWriter.writeControlFrameSynchronized(WebSocketWriter.java:152)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at okhttp3.internal.ws.WebSocketWriter.writeClose(WebSocketWriter.java:111)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at okhttp3.internal.ws.RealWebSocket.close(RealWebSocket.java:168)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.devsupport.JSPackagerWebSocketClient.closeWebSocketQuietly(JSPackagerWebSocketClient.java:104)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.devsupport.JSPackagerWebSocketClient.closeQuietly(JSPackagerWebSocketClient.java:98)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.devsupport.DevServerHelper.closePackagerConnection(DevServerHelper.java:129)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.devsupport.DevSupportManagerImpl.reload(DevSupportManagerImpl.java:846)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.devsupport.DevSupportManagerImpl.setDevSupportEnabled(DevSupportManagerImpl.java:481)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.XReactInstanceManagerImpl.onHostPause(XReactInstanceManagerImpl.java:490)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.XReactInstanceManagerImpl.onHostPause(XReactInstanceManagerImpl.java:504)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.ReactActivityDelegate.onPause(ReactActivityDelegate.java:110)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at com.facebook.react.ReactActivity.onPause(ReactActivity.java:60)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.Activity.performPause(Activity.java:6804)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1322)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:3711)
11-09 17:47:35.576  3706  3706 E AndroidRuntime:    ... 11 more
11-09 17:47:35.586  1228  1252 D AudioFlinger: mixer(0xed083c80) throttle end: throttle time(11)
11-09 17:47:35.624  1488  3199 I OpenGLRenderer: Initialized EGL, version 1.4
11-09 17:47:35.624  1488  3199 D OpenGLRenderer: Swap behavior 1
11-09 17:47:35.626  1221  1945 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
11-09 17:47:35.632  1221  1945 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
11-09 17:47:35.648  1221  1945 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
11-09 17:47:35.686  2175  3779 D DropBoxEntryAddedChimeraService: User is not opted-in to Usage & Diagnostics or Lockbox.
11-09 17:47:35.736  1488  1509 I WindowManager: Destroying surface Surface(name=com.xxx/com.xxx.MainActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2014 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:881 com.android.server.wm.WindowState.destroyOrSaveSurface:2073 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:491 com.android.server.wm.WindowAnimator.updateWindowsLocked:303 com.android.server.wm.WindowAnimator.animateLocked:704 
11-09 17:47:36.069  1488  1502 W ActivityManager: Activity pause timeout for ActivityRecord{2be8b48 u0 com.xxx/.MainActivity t6}
11-09 17:47:36.129  1488  1781 I ActivityManager: START u0 {act=android.intent.action.GET_CONTENT typ=image/*,video/* flg=0x3000000 cmp=com.android.documentsui/.DocumentsActivity (has extras)} from uid 10066 on display 0
11-09 17:47:36.221  1221  1945 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
11-09 17:47:36.232  1221  1263 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
11-09 17:47:36.244  1221  1263 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
11-09 17:47:36.397  1488  1509 I ActivityManager: Displayed com.android.documentsui/.DocumentsActivity: +256ms (total +327ms)
11-09 17:47:46.735  1488  1502 W ActivityManager: Activity stop timeout for ActivityRecord{2be8b48 u0 com.xxx/.MainActivity t6}

@superandrew213
Copy link
Contributor Author

Using react-native-image-picker causes same issue

@ivpusic
Copy link
Owner

ivpusic commented Nov 9, 2016

hm, googling a little bit about error... http://stackoverflow.com/questions/6343166/how-to-fix-android-os-networkonmainthreadexception, are you doing some network requests on main thread?

@superandrew213
Copy link
Contributor Author

Nope no network requests. Works fine on Android 6.

@ivpusic
Copy link
Owner

ivpusic commented Nov 13, 2016

@superandrew213 do you have time do debug this?

@superandrew213
Copy link
Contributor Author

@ivpusic I need this to work so I'm looking at it whenever I have free time

@superandrew213
Copy link
Contributor Author

I'm only testing this on sim because I don't have a device where I can install Android 7. Can anyone else with an Android 7 device test this?

@superandrew213
Copy link
Contributor Author

It doesn't seem to crash in release mode on sim. I guess we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants