Can I get some information as to how the Android Mobile Payments SDK interacts with BugSnag?

Hello,

I’m working on a Microsoft.Android binding for the Mobile Payments SDK. Currently I’m binding mobile-payments-sdk-2.0.0-beta2.aar and workflow-ui-core-android-1.12.1-beta09.aar (the latter because its attrs.xml file gets lost otherwise). This binding builds on its own and when referenced by a test Android app, but it crashes on app startup due to this error: ‘java.lang.ClassNotFoundException: Didn’t find class “shadow.com.bugsnag.android.internal.BugsnagContentProvider”’

If I use the Mobile Payments SDK in Android Studio, Gradle doesn’t restore any modules which appear to be BugSnag related. So I’m a little stumped as to which Square module is referencing BugSnag if any. I’m also curious as to what the Mobile Payments SDK does with BugSnag, either directly or via its dependencies, since if it’s sending user data we’d likely need to disclose that to Google and users.

Can I get some information as to how the Android Mobile Payments SDK interacts with BugSnag?

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build on Android: Reader SDK
Build on Android: Point of Sale API
In-App Payments SDK: How It Works

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Hello, @JonathonMinard

The java.lang.ClassNotFoundException for shadow.com.bugsnag.android.internal.BugsnagContentProvider suggests that there might be a missing dependency or an issue with how the dependencies are being resolved.

Here are a few steps and insights that might help:

Dependency Check: Ensure that all necessary dependencies for BugSnag are included in your project. Sometimes, dependencies might not be automatically resolved, especially in custom bindings.
BugSnag Integration: The BugSnag Android integration is designed to detect and report crashes from uncaught Java or Kotlin exceptions, C signal handlers, and C++ exceptions. It supports Android API level 14+ and NDK revision 12b and above.
Gradle Configuration: Double-check your Gradle configuration to ensure that BugSnag dependencies are correctly added. You might need to manually add the BugSnag dependency in your build.gradle file.
Square Module Reference: It’s possible that a Square module indirectly references BugSnag. Reviewing the documentation or reaching out to Square’s support might provide clarity on which module is causing this reference.
Privacy Concerns: If BugSnag is being used, it typically captures and reports crash data. You should review BugSnag’s documentation to understand what data is being collected and ensure you disclose this to users and comply with privacy regulations.

I hope this info is helpful to you.

Best Regard,
Gregory Chavez

At this time this is how we use BugSnag which is in line with industry standards:


:slightly_smiling_face:

Thanks for the replies.

I found that the BugSnap class is defined in mobile-payments-sdk-internals. But after including that JAR, it quickly became apparent that I needed to include all of the SDK’s dependencies regardless. If anyone’s curious, this is what I ended up with in my csproj file for the binding:

<ItemGroup>
  <PackageReference Include="GoogleGson" Version="2.11.0.1" />
  <PackageReference Include="Square.OkHttp3" Version="4.12.0.4" />
  <PackageReference Include="Square.OkHttp3.LoggingInterceptor" Version="4.12.0.4" />
  <PackageReference Include="Square.OkIO" Version="3.9.0" />
  <PackageReference Include="Square.Retrofit2" Version="2.11.0" />
  <PackageReference Include="Square.Retrofit2.AdapterRxJava2" Version="2.11.0" />
  <PackageReference Include="Square.Retrofit2.ConverterGson" Version="2.11.0" />
  <PackageReference Include="Xamarin.Android.ReactiveStreams" Version="1.0.4.14" />
  <PackageReference Include="Xamarin.Android.ReactiveX.RxAndroid" Version="2.1.1.13" />
  <PackageReference Include="Xamarin.Android.ReactiveX.RxJava" Version="2.2.21.20" />
  <PackageReference Include="Xamarin.AndroidX.Activity" Version="1.9.0.4" />
  <PackageReference Include="Xamarin.AndroidX.Activity.Compose" Version="1.9.0.4" />
  <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.4" />
  <PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.8.0.1" />
  <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.7.0.1" />
  <PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources" Version="1.7.0.1" />
  <PackageReference Include="Xamarin.AndroidX.Arch.Core.Common" Version="2.2.0.11" />
  <PackageReference Include="Xamarin.AndroidX.AutoFill" Version="1.1.0.26" />
  <PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.0.6" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Animation.Android" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Animation.Core.Android" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Foundation" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Foundation.Layout" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Material.Ripple.Android" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Runtime" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Runtime.RxJava2" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Runtime.Saveable" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.Runtime.Saveable.Android" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI.Android" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI.Geometry" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI.Text.Android" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI.Tooling.Preview" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI.Unit" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.Compose.UI.Util" Version="1.6.8.1" />
  <PackageReference Include="Xamarin.AndroidX.ConstraintLayout" Version="2.1.4.14" />
  <PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.3" />
  <PackageReference Include="Xamarin.AndroidX.Core.Core.Ktx" Version="1.13.1.3" />
  <PackageReference Include="Xamarin.AndroidX.DataBinding.ViewBinding" Version="8.5.0.1" />
  <PackageReference Include="Xamarin.AndroidX.DynamicAnimation" Version="1.0.0.27" />
  <PackageReference Include="Xamarin.AndroidX.ExifInterface" Version="1.3.7.5" />
  <PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.8.1.1" />
  <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.27" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Common.Java8" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Ktx" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ReactiveStreams.Ktx" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime.Ktx" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel.Ktx" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModelSavedState" Version="2.8.3.1" />
  <PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.3.2.6" />
  <PackageReference Include="Xamarin.AndroidX.Room.Common" Version="2.6.1.5" />
  <PackageReference Include="Xamarin.AndroidX.Room.Runtime" Version="2.6.1.5" />
  <PackageReference Include="Xamarin.AndroidX.SavedState" Version="1.2.1.11" />
  <PackageReference Include="Xamarin.AndroidX.Security.SecurityCrypto" Version="1.0.0.20" />
  <PackageReference Include="Xamarin.AndroidX.Sqlite" Version="2.4.0.6" />
  <PackageReference Include="Xamarin.AndroidX.Sqlite.Framework" Version="2.4.0.6" />
  <PackageReference Include="Xamarin.AndroidX.SwipeRefreshLayout" Version="1.1.0.22" />
  <PackageReference Include="Xamarin.AndroidX.Tracing.Tracing" Version="1.2.0.5" />
  <PackageReference Include="Xamarin.AndroidX.Transition" Version="1.5.0.3" />
  <PackageReference Include="Xamarin.AndroidX.VectorDrawable" Version="1.2.0.1" />
  <PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.2.0.1" />
  <PackageReference Include="Xamarin.AndroidX.VersionedParcelable" Version="1.2.0.5" />
  <PackageReference Include="Xamarin.AndroidX.ViewPager2" Version="1.1.0.1" />
  <PackageReference Include="Xamarin.AndroidX.Work.Runtime" Version="2.9.0.5" />
  <PackageReference Include="Xamarin.AndroidX.Work.Work.Runtime.Ktx" Version="2.9.0.5" />
  <PackageReference Include="Xamarin.Google.Android.Material" Version="1.11.0.1" />
  <PackageReference Include="Xamarin.Google.Android.Play.Integrity" Version="1.3.0.3" />
  <PackageReference Include="Xamarin.Google.Crypto.Tink.Android" Version="1.14.0.1" />
  <PackageReference Include="Xamarin.Google.Dagger" Version="2.51.1" />
  <PackageReference Include="Xamarin.Google.Guava.ListenableFuture" Version="1.0.0.22" />
  <PackageReference Include="Xamarin.Google.ZXing.Core" Version="3.5.3.2" />
  <PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.5.0" />
  <PackageReference Include="Xamarin.GooglePlayServices.Basement" Version="118.4.0" />
  <PackageReference Include="Xamarin.GooglePlayServices.Tasks" Version="118.2.0" />
  <PackageReference Include="Xamarin.JavaX.Inject" Version="1.0.0.14" />
  <PackageReference Include="Xamarin.Kotlin.StdLib" Version="2.0.0.1" />
  <PackageReference Include="Xamarin.Kotlin.StdLib.Common" Version="2.0.0.1" />
  <PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="2.0.0.1" />
  <PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="2.0.0.1" />
  <PackageReference Include="Xamarin.KotlinX.Coroutines.Android" Version="1.8.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Coroutines.Core" Version="1.8.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Coroutines.Play.Services" Version="1.8.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Coroutines.Reactive" Version="1.8.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Coroutines.Rx2" Version="1.8.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Serialization.Core.Jvm" Version="1.7.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Serialization.Protobuf" Version="1.7.1.1" />
  <PackageReference Include="Xamarin.KotlinX.Serialization.Protobuf.Jvm" Version="1.7.1.1" />
</ItemGroup>
<ItemGroup>
  <AndroidLibrary Update="lib\com.evernote\android-job-1.4.3.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.google.protobuf\protobuf-java-3.25.3.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.googlecode.libphonenumber\libphonenumber-8.13.19.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.jakewharton\process-phoenix-2.0.0.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.jakewharton.rxrelay2\rxrelay-2.1.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.jakewharton.threetenabp\threetenabp-1.4.4.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.coordinators\coordinators-0.5.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.curtains\curtains-1.2.5.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\leakcanary-android-utils-3.0-alpha-4.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\leakcanary-core-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\leakcanary-gc-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\leakcanary-object-watcher-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\leakcanary-object-watcher-android-core-3.0-alpha-4.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\shark-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\shark-graph-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\shark-hprof-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.leakcanary\shark-log-3.0-alpha-4.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.logcat\logcat-0.1.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.moshi\moshi-1.15.1.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.moshi\moshi-adapters-1.15.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.papa\papa-0.14.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.papa\papa-safetrace-0.14.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.picasso\picasso-3.0.0-alpha03.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.retrofit2\converter-moshi-2.11.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.retrofit2\converter-protobuf-2.11.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.retrofit2\converter-wire-2.11.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sdk\mobile-payments-sdk-2.0.0-beta2.aar" Bind="true" />
  <AndroidLibrary Update="lib\com.squareup.sdk\mobile-payments-sdk-internals-2.0.0-beta2.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sdk\mockreader-ui-2.0.0-beta2.aar" Bind="true" />
  <AndroidLibrary Update="lib\com.squareup.sdk\mockreader-ui-internals-2.0.0-beta2.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sqldelight\android-driver-1.5.5.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sqldelight\jdbc-driver-1.5.5.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sqldelight\runtime-jvm-1.5.5.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sqldelight\rxjava2-extensions-1.5.5.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sqldelight\sqldelight-coroutines-extensions-jvm-1.5.5.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.sqldelight\sqlite-driver-1.5.5.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.wire\wire-gson-support-4.7.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.wire\wire-runtime-jvm-4.7.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.workflow1\workflow-core-jvm-1.12.1-beta09.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.workflow1\workflow-runtime-jvm-1.12.1-beta09.jar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.workflow1\workflow-ui-compose-1.12.1-beta09.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.workflow1\workflow-ui-core-android-1.12.1-beta09.aar" Bind="false" />
  <AndroidLibrary Update="lib\com.squareup.workflow1\workflow-ui-core-common-jvm-1.12.1-beta09.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.bouncycastle\bcprov-jdk15on-1.70.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.jetbrains.kotlin\kotlin-android-extensions-runtime-1.9.20.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.jetbrains.kotlin\kotlin-parcelize-runtime-1.9.20.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.jetbrains.kotlinx\kotlinx-collections-immutable-jvm-0.3.5.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.jetbrains.kotlinx\kotlinx-serialization-json-jvm-1.5.0.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.jsoup\jsoup-1.15.4.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.threeten\threetenbp-1.6.5-no-tzdb.jar" Bind="false" />
  <AndroidLibrary Update="lib\org.xerial\sqlite-jdbc-3.34.0.jar" Bind="false" />
</ItemGroup>