sentry-java
sentry-java copied to clipboard
Upgrade to Android 13 sdk
:scroll: Description
This pr is still a draft: to work with the new agp version, the latest version of Android Studio is needed. It is already out in the stable version, but we should be sure everyone updated before merging this pr into master.
upgraded Android Gradle Plugin to 7.3.0 upgraded target and compile sdk of sample app to 33 (android 13) updated getPackageInfo and getApplicationInfo deprecated methods
:bulb: Motivation and Context
We want to make sure the Android sdk can be built without issues when targeting the latest Android version, currently 13. So we upgrade our sample app to sdk 33 and fix any deprecation issues, other than testing the app is working fine.
:green_heart: How did you test it?
Just running the app locally. We want to run ui tests on Android 13 devices, but we are going to do it when Saucelabs will have working devices with Android 13. There is a separate pr for this.
:pencil: Checklist
- [ ] I reviewed the submitted code
- [ ] I added tests to verify the changes
- [ ] I updated the docs if needed
- [x] No breaking changes
:crystal_ball: Next steps
Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 324.57 ms | 429.16 ms | 104.59 ms |
| Size | 1.73 MiB | 2.29 MiB | 578.36 KiB |
Baseline results on branch: main
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3d89dea01bc94d77c82e013014fd7be0541fff62 | 345.59 ms | 364.06 ms | 18.47 ms |
| 1e4690d24ef94b303d6b8f1bff3060eb7422e168 | 354.69 ms | 387.88 ms | 33.19 ms |
| 3d89dea01bc94d77c82e013014fd7be0541fff62 | 322.38 ms | 350.82 ms | 28.45 ms |
| 2f079a1dcf2d55d9a587ba534f27df2f57c82bf6 | 296.91 ms | 337.43 ms | 40.51 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3d89dea01bc94d77c82e013014fd7be0541fff62 | 1.74 MiB | 2.33 MiB | 604.92 KiB |
| 1e4690d24ef94b303d6b8f1bff3060eb7422e168 | 1.74 MiB | 2.33 MiB | 604.92 KiB |
| 3d89dea01bc94d77c82e013014fd7be0541fff62 | 1.74 MiB | 2.33 MiB | 604.92 KiB |
| 2f079a1dcf2d55d9a587ba534f27df2f57c82bf6 | 1.74 MiB | 2.33 MiB | 605.56 KiB |
Previous results on branch: android_target_sdk_33
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5ec80f40dabb932657779592bfd18415a3fbe098 | 333.24 ms | 375.65 ms | 42.41 ms |
| e743770d13c3d48e67324f18f18cf3526702a00a | 292.57 ms | 331.86 ms | 39.29 ms |
| f8b03cb3f4dea48fa32d43bd90db9e5f3e69ebb0 | 346.86 ms | 370.68 ms | 23.82 ms |
| fb223901030e41352daa5d8adb9d8a78cf00b2f9 | 328.43 ms | 389.27 ms | 60.84 ms |
| ffd7905d0f618d157e41864ca917280b5a20e3e5 | 332.70 ms | 434.72 ms | 102.02 ms |
| 2ad76313d2a262324a3b156acd94b1b5c0ffdc70 | 334.92 ms | 400.10 ms | 65.19 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5ec80f40dabb932657779592bfd18415a3fbe098 | 1.73 MiB | 2.29 MiB | 577.10 KiB |
| e743770d13c3d48e67324f18f18cf3526702a00a | 1.74 MiB | 2.29 MiB | 562.11 KiB |
| f8b03cb3f4dea48fa32d43bd90db9e5f3e69ebb0 | 1.73 MiB | 2.29 MiB | 578.29 KiB |
| fb223901030e41352daa5d8adb9d8a78cf00b2f9 | 1.73 MiB | 2.29 MiB | 578.43 KiB |
| ffd7905d0f618d157e41864ca917280b5a20e3e5 | 1.74 MiB | 2.29 MiB | 562.46 KiB |
| 2ad76313d2a262324a3b156acd94b1b5c0ffdc70 | 1.73 MiB | 2.29 MiB | 577.10 KiB |
@stefanosiano since you are on it already, could you also tackle https://github.com/getsentry/sentry-java/issues/2133? It's about switching from AndroidManifest to namespace attribute in build.gradle. I planned to do it when updating to AGP 7.3.0, but you've already done it here.
Otherwise the PR LGTM 👍
@romtsn sure, i'll put it here, too
Codecov Report
Base: 80.62% // Head: 80.53% // Decreases project coverage by -0.09% :warning:
Coverage data is based on head (
aa617fc) compared to base (3d89dea). Patch has no changes to coverable lines.
Additional details and impacted files
@@ Coverage Diff @@
## main #2251 +/- ##
============================================
- Coverage 80.62% 80.53% -0.10%
- Complexity 3368 3393 +25
============================================
Files 240 240
Lines 12388 12461 +73
Branches 1646 1659 +13
============================================
+ Hits 9988 10035 +47
- Misses 1791 1813 +22
- Partials 609 613 +4
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...ry/src/main/java/io/sentry/TransactionContext.java | 60.78% <0.00%> (-14.22%) |
:arrow_down: |
| sentry/src/main/java/io/sentry/Baggage.java | 83.22% <0.00%> (-6.20%) |
:arrow_down: |
| ...ring/tracing/SentrySpanClientWebRequestFilter.java | 63.63% <0.00%> (-3.87%) |
:arrow_down: |
| sentry/src/main/java/io/sentry/SentryTracer.java | 90.82% <0.00%> (-0.66%) |
:arrow_down: |
| sentry/src/main/java/io/sentry/TraceContext.java | 82.83% <0.00%> (-0.60%) |
:arrow_down: |
| sentry/src/main/java/io/sentry/Span.java | 100.00% <0.00%> (ø) |
|
| sentry/src/main/java/io/sentry/NoOpSpan.java | 25.00% <0.00%> (ø) |
|
| ...n/java/io/sentry/apollo/SentryApolloInterceptor.kt | 81.57% <0.00%> (ø) |
|
| ...racing/SentrySpanClientHttpRequestInterceptor.java | 0.00% <0.00%> (ø) |
|
| ...in/java/io/sentry/openfeign/SentryFeignClient.java | 97.05% <0.00%> (+0.33%) |
:arrow_up: |
| ... and 4 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@romtsn i did the change. Of course, i didn't make the change to agp 8 would you give another look? Also, should i merge this pr now, or should i wait a little bit until we are sure everyone updated android studio?
Looks good 👍 I'd merge it now, since it's just a few of us who uses AS and shouldn't be a problem to update. Since AS Dolphin is already stable, I think it's an easy update.