> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/help-center/help-topics/connecting/apple-health-health-connect-and-mobile-sdk/samsung-production-sdk-switch-and-signing.md).

# Why does Samsung Health throw AuthorizationException 2000 in release but work in debug?

There's no Samsung Developer ID to add on the Terra SDK or in your app code.

There's no Samsung Developer ID to add on the Terra SDK or in your app code. If Samsung Health throws `AuthorizationException 2000` ('app not allowed to read steps') in a release build but works in debug, check these three causes:

{% stepper %}
{% step %}
**Signing-key / registration mismatch.** Samsung authorises your app by matching the Android package name and the release-build signing certificate SHA-256 fingerprint against what you registered in Samsung's partner portal. Samsung Health's developer mode [bypasses this check](https://developer.samsung.com/health/data/guide/app-verification.html), which is why a build can work with developer mode on and fail with it off. Confirm both the release `applicationId` and the release SHA-256 are registered and approved, and check the `applicationId` of your production build flavour, which often differs from your test build. If you use Play App Signing, use the Play Console App signing SHA-256. If you only registered the debug fingerprint, add the release one before going live. To see which certificate a phone actually has, pull the installed APK from it and run [`apksigner verify --print-certs`](https://developer.android.com/tools/apksigner).
{% endstep %}

{% step %}
**Permission mismatch.** Confirm the read permissions your app requests match what was approved, and that the user actually granted them.
{% endstep %}

{% step %}
**ProGuard / R8 stripping.** Release builds shrink code, which can strip classes the SDK needs. Add a keep rule for `com.samsung.android.**` in your release ProGuard config.
{% endstep %}
{% endstepper %}

On native Android, use the separate Samsung direct artifact [`co.tryterra:android-sdk`](https://central.sonatype.com/artifact/co.tryterra/android-sdk) in place of `co.tryterra:terra-android`. It is not a tagged version of `terra-android`, and your `initConnection(Connections.SAMSUNG, ...)` call stays the same.

If all three check out and the error persists, contact support with your package name and the user\_id. In some cases a pre-obfuscated AAR means keep-rules do not reliably fix Parcelable deserialisation, which is a known issue we handle on our side.
