getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.56k stars 330 forks source link

Android sentry.gradle script does not work for release builds with gradle-play-publisher #2904

Open Legion2 opened 1 year ago

Legion2 commented 1 year ago

OS:

Platform:

SDK:

SDK version: 5.0.0

react-native version: 0.69.4

Are you using Expo?

Are you using sentry.io or on-premise?


I have following issue:

Gradle release build fails with java.io.FileNotFoundException: .../available-version-codes.txt (No such file or directory),when using gradle-play-publisher plugin. The gradle-play-publisher plugin resolve the versionCode dynamically from the play store API. But when the sentry gradle script tries to read the versionCode an exception is thrown. According to a similar issue the sentry.gradle uses a legacy API to get the versionCode, which causes this error.

Steps to reproduce:

Actual result:

Build fails with java.io.FileNotFoundException: .../available-version-codes.txt (No such file or directory) error message.

Expected result:

Build does not fail and upload source maps and android release app.

krystofwoldrich commented 1 year ago

Thank you for the details and steps to reproduce, we will discuss internally if we will add support for gradle-play-publisher. Seems like we need to use a different API to get versionCode but, we need to be sure it doesn't break anything else.

marandaneto commented 1 year ago

Let's fix the gradle script to not throw the exception, swallow and log it out, and look into adding support for the Play publisher in a different PR/issue. They can as of now init the SDK manually passing a custom release and dist if dynamically generated by a 3rd party tool.

marandaneto commented 1 year ago

Created https://github.com/getsentry/sentry-react-native/issues/2924 for the feature request

github-actions[bot] commented 1 year ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Legion2 commented 1 year ago

Bump

ishroid commented 1 year ago

Having same issue with KMP compose projects.

krystofwoldrich commented 1 year ago

@ishroid Could you share a bit more context? Are you using sentry-react-native and KMP in the same project? Or are you having the same issue with https://github.com/getsentry/sentry-kotlin-multiplatform?

ishroid commented 1 year ago

Sorry, looks like my comment out of context here, i am not using sentry-react-native my comment should be on gradle-play-publisher gitbut.

Rohphi commented 1 year ago

Same issue here,

arpkirill commented 3 months ago

Hasn't the situation changed? Do plugins still conflict?

krystofwoldrich commented 3 months ago

@arpkirill No changes yet, but thank you for the message, feel free to up vote the issue, this helps up prioritizing the task.