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

App crashing on selection of gif(Android) #90

Closed
Aman1706 opened this issue Dec 13, 2022 · 5 comments · Fixed by #95
Closed

App crashing on selection of gif(Android) #90

Aman1706 opened this issue Dec 13, 2022 · 5 comments · Fixed by #95
Labels
bug Something isn't working

Comments

@Aman1706
Copy link

Aman1706 commented Dec 13, 2022

🐛 Bug Report

If a user tries to select a gif in the GiphyDialog menu, the app crashes
This is happening for android and only for an apk or aab build, it works fine when running in debug.

I was using an older version of this package and then bumped it up to the latest, after that this issue occurred.

Looking at sentry I see this error

RuntimeException com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run
New Issue
Unhandled
java.lang.reflect.InvocationTargetException

To Reproduce

(Write your steps here:)

  1. Open the Gif menu on an android device
  2. Select a gif

Your Environment

  • Giphy React Native SDK version: 2.1.0
  • React Native version:0.68.5
  • Platform(s) (iOS, Android, or both?): android
  • Device info (Simulator/Device? OS version? Debug/Release?): Pixel 3A ARM64 emulator - Android 12 (Bug happens for release build only)

Reproducible Demo

Screen.Recording.2022-12-13.at.4.33.03.PM.mov
@Aman1706 Aman1706 added the bug Something isn't working label Dec 13, 2022
@Aman1706
Copy link
Author

FYI I downgraded the version to 2.0.0 and it works fine there
Looks like its some issue with 2.1.0

@pshoniuk
Copy link
Contributor

pshoniuk commented Jan 4, 2023

Hi @Aman1706! Sorry for the delayed response. We can't reproduce the issue with an example app. Could you please create some minimal playground where this problem occurs? Or, if you have more detailed information about the error, such as a stake trace, could you please share it? That would be very helpful

@ujjwal-techahead-personal
Copy link

ujjwal-techahead-personal commented Feb 28, 2023

@pshoniuk , I too am facing the same issue. Only happens in release builds on Android.

Here is the error I get if I run my app in Android Studio with the build variant set to release:

--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myproject, PID: 7868
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
Caused by: kotlin.reflect.full.IllegalCallableAccessException: java.lang.IllegalAccessException: Class java.lang.Class<kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter> cannot access private final field com.giphy.sdk.core.models.Image com.giphy.sdk.core.models.Images.downsized of class java.lang.Class<com.giphy.sdk.core.models.Images>
at kotlin.reflect.jvm.internal.KCallableImpl.call(Unknown Source:17)
at kotlin.reflect.jvm.internal.KProperty1Impl.get(Unknown Source:10)
at com.giphyreactnativesdk.s.c(Unknown Source:51)
at com.giphyreactnativesdk.s.a(Unknown Source:17)
at com.giphyreactnativesdk.s.b(Unknown Source:27)
at com.giphyreactnativesdk.GiphyReactNativeDialogModule$b.c(Unknown Source:24)
at com.giphy.sdk.ui.views.c.E3(Unknown Source:61)
at com.giphy.sdk.ui.views.c.y3(Unknown Source:41)
at com.giphy.sdk.ui.views.c.s2(Unknown Source:0)
at cc.u0.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
Caused by: java.lang.IllegalAccessException: Class java.lang.Class<kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter> cannot access private final field com.giphy.sdk.core.models.Image com.giphy.sdk.core.models.Images.downsized of class java.lang.Class<com.giphy.sdk.core.models.Images>
at java.lang.reflect.Field.get(Native Method)
at kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter.call(Unknown Source:26)
at kotlin.reflect.jvm.internal.KCallableImpl.call(Unknown Source:9)
at kotlin.reflect.jvm.internal.KProperty1Impl.get(Unknown Source:10) 
at com.giphyreactnativesdk.s.c(Unknown Source:51) 
at com.giphyreactnativesdk.s.a(Unknown Source:17) 
at com.giphyreactnativesdk.s.b(Unknown Source:27) 
at com.giphyreactnativesdk.GiphyReactNativeDialogModule$b.c(Unknown Source:24) 
at com.giphy.sdk.ui.views.c.E3(Unknown Source:61) 
at com.giphy.sdk.ui.views.c.y3(Unknown Source:41) 
at com.giphy.sdk.ui.views.c.s2(Unknown Source:0) 
at cc.u0.onClick(Unknown Source:2) 
at android.view.View.performClick(View.java:7448) 
at android.view.View.performClickInternal(View.java:7425) 
at android.view.View.access$3600(View.java:810) 
at android.view.View$PerformClick.run(View.java:28305) 
at android.os.Handler.handleCallback(Handler.java:938) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:223) 
at android.app.ActivityThread.main(ActivityThread.java:7656) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

@pshoniuk
Copy link
Contributor

pshoniuk commented Mar 1, 2023

Hi @ujjwal-techahead-personal
Thank you for the report. We reproduced the issue on our side. The problem seems to be related to ProGuard misconfiguration. I'll update the status here when we have new information.

@pshoniuk
Copy link
Contributor

pshoniuk commented Mar 2, 2023

@ujjwal-techahead-personal We've released a fix in v2.1.3. Please check it when you get a chance. If the problem still occurs, please reopen this issue or create a new one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants