View on GitHub

sensibill-android-documentation

Troubleshooting

If you’re having trouble integrating with the Sensibill SDK, here’s how you can try to fix some commonly reported issues.

1- Branding Integration

If you’re getting an app crash every time you open an SDK screen with the following Exception:

Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Make sure that Theme.Sensibill or a style extending Theme.Sensibill is applied to any activity hosting a Sensibill Fragment in your app.

In your styles definition, here is how it should look:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.Sensibill">
    <!--Add application Specific customization here-->
</style>

Refer to the customization section of the documentation to check how to configure branding colours. (Customization)

2- Changing fonts

When using custom fonts, if you keep seeing the default system fonts (e.g. on the main receipt list) in your own activities that host Sensibill fragments, this could be because this behaviour requires extra configuration to work.

This extra configuration allows the Calligraphy library to easily replace the fonts in your activity without extra effort.

To enable the configuration, override the attachBaseContext method in every activity that hosts Sensibill fragments. Like below:

Java

@Override
protected void attachBaseContext(Context newBase) {
    super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}

Kotlin

override fun attachBaseContext(newBase: Context) {
    super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase))
}