Android sentry.gradle script does not work for release builds with gradle-play-publisher
OS:
- [ ] Windows
- [ ] MacOS
- [x] Linux
Platform:
- [ ] iOS
- [x] Android
SDK:
- [x]
@sentry/react-native(>= 1.0.0) - [ ]
react-native-sentry(<= 0.43.2)
SDK version: 5.0.0
react-native version: 0.69.4
Are you using Expo?
- [ ] Yes
- [x] No
Are you using sentry.io or on-premise?
- [x] sentry.io (SaaS)
- [ ] 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:
- Setup android project
- Setup
gradle-play-publisherplugin to autoresolve version codes
play {
// ...
resolutionStrategy.set(ResolutionStrategy.IGNORE)
}
- Add
sentry.gradlescript to gradle build script - Make a release build
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.
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.
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.
Created https://github.com/getsentry/sentry-react-native/issues/2924 for the feature request
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 🥀
Bump
Having same issue with KMP compose projects.
@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?
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.
Same issue here,
Hasn't the situation changed? Do plugins still conflict?
@arpkirill No changes yet, but thank you for the message, feel free to up vote the issue, this helps up prioritizing the task.