> For the complete documentation index, see [llms.txt](https://docs.firework.com/firework-for-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.firework.com/firework-for-developers/android-sdk/faq-and-troubleshooting.md).

# FAQ & Troubleshooting

<details>

<summary>Historical Android 12 PendingIntent crash (older WorkManager dependencies)</summary>

Some older dependency combinations produced the following Android 12 error. Diagnose the resolved WorkManager version rather than assuming every app using AGP 7.2.0 is affected:

```
2022-06-14 11:30:19.954 21270-21290/tv.fw.example.discovery E/AndroidRuntime: FATAL EXCEPTION: pool-3-thread-1
    Process: tv.fw.example.discovery, PID: 21270
    java.lang.IllegalArgumentException: tv.fw.example.discovery: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
        at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
        at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174)
        at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108)
        at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86)
        at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:920)

```

The historical workaround used WorkManager 2.7.1, as discussed in [the original report](https://stackoverflow.com/a/69152986/2359762). This is not a recommendation to pin a current app to that old version:

```
    // Required to avoid crash on Android 12 API 31
    // https://stackoverflow.com/a/69152986/2359762
    implementation("androidx.work:work-runtime-ktx:2.7.1")
```

Inspect your resolved dependency tree and choose a WorkManager version compatible with your application. Keep this workaround limited to the matching historical crash.

</details>

## Analytics callbacks missing in minified builds

SDK **6.35.1** fixes a known issue where R8 could remove analytics callbacks. If you encounter this issue on an older SDK, upgrade to a version containing the fix. The standard SDK artifact includes the required callback keep rules.

Ensure the listener is still registered while events are expected and follows the [analytics registration lifecycle](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/analytics.md#firework-analytics).

## Manifest merger fails for a player activity

Since **6.37.1**, the SDK declares its fullscreen player activities with `android:exported="false"`:

* `com.firework.player.pager.PlayerActivity`
* `com.firework.player.pager.SingleInstancePlayerActivity`
* `com.firework.player.pager.SeparateSingleTaskPlayerActivity`

The SDK starts these activities from inside your app, so they don't need to be exported. If your app's `AndroidManifest.xml` redeclares one of them with `android:exported="true"`, for example to change its theme or orientation, the build fails with an error like this:

```
Manifest merger failed : Attribute activity#com.firework.player.pager.PlayerActivity@exported value=(true) ...
Suggestion: add 'tools:replace="android:exported"' to <activity> element ...
```

Remove `android:exported="true"` from your redeclaration. Your other attributes still apply, and the activity keeps the SDK's `false` value. A redeclaration without `android:exported` is not affected.

Keep the attribute only if another app must start the player activity. In that case, override the SDK's value with `tools:replace`:

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application>
        <activity
            android:name="com.firework.player.pager.PlayerActivity"
            android:exported="true"
            tools:replace="android:exported" />
    </application>
</manifest>
```

This exports the activity again, so any app on the device can start it. Since 6.37.1, a player activity started without the SDK's launch data closes instead of crashing your app.

## Targeting Android 16 (API 36)

SDK **6.37.0** and later support apps that set `targetSdk` to 36. Google Play requires new apps and app updates to target recent Android versions. If your app targets Android 16, use 6.37.0 or later.

When an app targets Android 16, predictive back is turned on by default and the system no longer calls `Activity.onBackPressed()`. Back is delivered only to callbacks registered with the AndroidX `OnBackPressedDispatcher`. Since 6.37.0, the fullscreen player, StoryBlock fullscreen, and the shopping sheets register their own callbacks there. Back closes an open shopping sheet first, then exits the player.

Check the following in your app:

* **Your own Back handling:** If an activity that hosts SDK widgets handles Back by overriding `onBackPressed()`, move that logic to an `OnBackPressedCallback`. The SDK's callbacks run alongside yours: the most recently added enabled callback handles Back first.
* **AndroidX Activity version:** The SDK now depends on `androidx.activity:activity` 1.6.1 or later. If your app already uses a newer version, Gradle uses yours. Version 1.6.1 requires `compileSdk` 33 or higher.
* **Screen orientation on large screens:** When an app targets Android 16, the system ignores orientation locks on displays whose smallest width is 600dp or more, such as tablets and unfolded foldables. On these devices the fullscreen player can rotate even when [`enableRotateOrientation`](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/configuration/player-options.md#enablerotateorientation) is `false`. Phones are not affected. Test the player on a large screen. Android 16 provides a temporary opt-out, the `android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY` manifest property, which no longer applies once your app targets Android 17. See [Android 16 behavior changes](https://developer.android.com/about/versions/16/behavior-changes-16).
* **No SDK option is required:** The SDK does not set your app's `targetSdk`. Your app keeps its own `minSdk`, `compileSdk`, and `targetSdk`. The SDK minimum remains API 21.
