Skip to content

Commit 5b0b144

Browse files
Prevent users building with AndroidEnableAssemblyCompression set to false (#4089)
* Prevent users building with AndroidEnableAssemblyCompression set to false * Update CHANGELOG.md * Update src/Sentry/buildTransitive/Sentry.targets Co-authored-by: James Crosswell <[email protected]> * Update Sentry.Samples.Android.csproj --------- Co-authored-by: James Crosswell <[email protected]>
1 parent 762c056 commit 5b0b144

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Changed default value for `SentryOptions.EnableAppHangTrackingV2` to `false` ([#4042](https://github.com/getsentry/sentry-dotnet/pull/4042))
2323
- Missing MAUI `Shell` navigation breadcrumbs on iOS ([#4006](https://github.com/getsentry/sentry-dotnet/pull/4006))
2424
- Prevent application crashes when capturing screenshots on iOS ([#4069](https://github.com/getsentry/sentry-dotnet/pull/4069))
25+
- Prevent users from disabling AndroidEnableAssemblyCompression which leads to untrappable crash ([#4089](https://github.com/getsentry/sentry-dotnet/pull/4089))
2526

2627
### Dependencies
2728

src/Sentry/buildTransitive/Sentry.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
<SentryAttributesFile>Sentry.Attributes$(MSBuildProjectExtension.Replace('proj', ''))</SentryAttributesFile>
1010
</PropertyGroup>
1111

12+
<Target Name="_SentryEnsureAndroidEnableAssemblyCompressionDisabled"
13+
Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' AND '$(AndroidEnableAssemblyCompression)' == 'false'"
14+
BeforeTargets="ResolveAssemblyReferences;Build;Rebuild">
15+
<Error Text="Android projects using Sentry cannot build using AndroidEnableAssemblyCompression = false due to a Microsoft issue. Please follow https://github.com/dotnet/android/issues/9752" />
16+
</Target>
17+
1218
<Target Name="WriteSentryAttributes"
1319
Condition="$(Language) == 'VB' or $(Language) == 'C#' or $(Language) == 'F#'"
1420
BeforeTargets="BeforeCompile;CoreCompile"

0 commit comments

Comments
 (0)