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 App crashes when selecting an Image with ( java.net.SocketException) #2109

Open
SiddhantSharma575 opened this issue Nov 19, 2024 · 4 comments

Comments

@SiddhantSharma575
Copy link

Version

Tell us which versions you are using:

  • react-native-image-crop-picker : ^0.41.5
  • react-native v0.73.6

Platform

  • Android

Expected behaviour

App should works fine with image picking

Actual behaviour

The Android app crashes unexpectedly when selecting an image. However, after reopening the app following the crash, it works without issues. This problem occurs only on the first installation of the app. If the app is already installed and then updated, the issue does not arise. The crash is accompanied by the following exception:
it's giving an socket exception although i am not using any websocket in my codebase.

Error occurred, shutting down websocket connection: Websocket exception java.net.SocketException: Software caused connection abort at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:118) at java.net.SocketInputStream.read(SocketInputStream.java:173) at java.net.SocketInputStream.read(SocketInputStream.java:143) at okio.InputStreamSource.read(JvmOkio.kt:91) at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129) at okio.RealBufferedSource.request(RealBufferedSource.kt:206) at okio.RealBufferedSource.require(RealBufferedSource.kt:199) at okio.RealBufferedSource.readByte(RealBufferedSource.kt:209) at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119) at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102) at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293) at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)

Steps to reproduce

  1. Install the application and tried to pick an image

  2. App got crashed with above exception

  3. When i re-open the app it works fine.

Attachments

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective:
👉 https://opencollective.com/react-native-image-crop-picker/donate

@santisilva
Copy link

Do you still have this problem? try this:
add # For react-native-image-crop-picker -keep class com.reactnative.imagecroppicker.** { ; } -keep class com.yalantis.ucrop.* { *; }
in android/app/proguard-rules.pro

@pierroo
Copy link

pierroo commented Dec 31, 2024

Do you still have this problem? try this: add # For react-native-image-crop-picker -keep class com.reactnative.imagecroppicker.** { ; } -keep class com.yalantis.ucrop.* { *; } in android/app/proguard-rules.pro

FYI, I added those lines as you suggested:

# For react-native-image-crop-picker
-keep class com.reactnative.imagecroppicker.** { ; }
-keep class com.yalantis.ucrop.* { *; }

but then my build in release mode will crash with those lines.

it should have been:

-keep class com.reactnative.imagecroppicker.** { *; }
-keep class com.yalantis.ucrop.** { *; }

@akshSekhon
Copy link

I am also facing this issue have you found any solution?

@sahad00
Copy link

sahad00 commented Jan 6, 2025

any solution for android crash ?

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

5 participants