Skip to content

Commit

Permalink
Sentry crash on Android release - fix (#646)
Browse files Browse the repository at this point in the history
* Proguard file updated to prevent crash on release

* Fix workload version for android

* Tracing disabled

* Sentry updated

* Fix workload version for android reverted
  • Loading branch information
akrol95 authored Jan 10, 2025
1 parent 1877701 commit 4792ac3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion BMM.Core/BMM.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="MvvmCross.Plugin.JsonLocalization" Version="9.2.0" />
<PackageReference Include="MvvmCross.Plugin.Messenger" Version="9.2.0" />
<PackageReference Include="MvvmCross.Plugin.Visibility" Version="9.2.0" />
<PackageReference Include="Sentry" Version="5.0.0" />
<PackageReference Include="Sentry" Version="5.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.34.0" />
<PackageReference Include="TagLibSharp" Version="2.3.0" />
<PackageReference Update="Microsoft.Maui.Graphics" Version="8.0.80" />
Expand Down
3 changes: 2 additions & 1 deletion BMM.UI.Android/AndroidSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
using FFImageLoading;
using FFImageLoading.Cache;
using FFImageLoading.Config;
using Firebase;
using Google.Android.Material.FloatingActionButton;
using Google.Android.Material.Navigation;
using IdentityModel.OidcClient.Browser;
Expand Down Expand Up @@ -156,7 +157,7 @@ protected override void InitializeFirstChance(IMvxIoCProvider iocProvider)
var stopwatch = iocProvider.Resolve<IStopwatchManager>();
stopwatch.StartAndGetStopwatch(StopwatchType.AppStart);

Firebase.FirebaseApp.InitializeApp(ApplicationContext);
FirebaseApp.InitializeApp(ApplicationContext);

iocProvider.RegisterType<INotificationSubscriptionTokenProvider, FirebaseTokenProvider>();
#if DEBUG
Expand Down
5 changes: 2 additions & 3 deletions BMM.UI.Android/BMM.UI.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PackageReference Include="MvvmCross.DroidX.SwipeRefreshLayout" Version="9.2.0" />
<PackageReference Include="MvvmCross.Plugin.Color" Version="9.2.0" />
<PackageReference Include="MvvmCross.Plugin.JsonLocalization" Version="9.2.0" />
<PackageReference Include="Sentry" Version="5.0.0" />
<PackageReference Include="Sentry" Version="5.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="XAB.FlexboxLayout" Version="3.0.0.2" />
<PackageReference Include="Xam.Plugins.Android.ExoPlayer" Version="2.19.1" />
Expand Down Expand Up @@ -1097,8 +1097,7 @@
</AndroidResource>
</ItemGroup>
<ItemGroup>
<None Remove="google-services.json" />
<GoogleServicesJson Include="google-services.json" />
<GoogleServicesJson Include="google-services.json" LogicalName="google-services.json" />
</ItemGroup>
<ItemGroup>
<Content Include="Application\.DS_Store" />
Expand Down
5 changes: 4 additions & 1 deletion BMM.UI.Android/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
-keep class androidx.viewpager.widget.** { *; }
-keep class androidx.core.graphics.** { *; }
-keep class androidx.browser.customtabs.** { *; }
-keep class androidx.appcompat.widget.** { *; }
-dontwarn androidx.recyclerview.widget.**

-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }
-keep class com.google.android.material.navigation.** { *; }
-keep class com.microsoft.appcenter.** { *; }
-dontwarn com.google.android.gms.**
-dontwarn com.google.android.gms.**

-keep public class com.google.android.material.internal.BaselineLayout
2 changes: 1 addition & 1 deletion BMM.UI.iOS/BMM.UI.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@
<PackageReference Include="MvvmCross" Version="9.2.0" />
<PackageReference Include="MvvmCross.Plugin.Color" Version="9.2.0" />
<PackageReference Include="MvvmCross.Plugin.JsonLocalization" Version="9.2.0" />
<PackageReference Include="Sentry" Version="5.0.0" />
<PackageReference Include="Sentry" Version="5.0.1" />
<PackageReference Include="Serilog" Version="4.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Xamarin.Firebase.iOS.CloudMessaging" Version="8.10.0.3" />
Expand Down
11 changes: 1 addition & 10 deletions azure-pipelines-android.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
pool:
name: Azure Pipelines
vmImage: 'windows-2022'
vmImage: 'macOS-13'
demands:
- npm
- msbuild
- MSBuild
- JDK

trigger:
branches:
Expand All @@ -19,12 +16,6 @@ variables:
branchName: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]

steps:
- task: JavaToolInstaller@0
displayName: 'Use Java 21'
inputs:
versionSpec: 21
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- bash: |
dotnet workload install android
displayName: 'Install Android workload'
Expand Down

0 comments on commit 4792ac3

Please sign in to comment.