# Troubleshooting Common issues and solutions for Airship SDK setup, initialization, and integration. # Troubleshooting Initialization > Troubleshoot common initialization issues and apply solutions. When following steps in [Getting Started](https://www.airship.com/docs/developer/sdk-integration/android/installation/getting-started/) or [Advanced Integration](https://www.airship.com/docs/developer/sdk-integration/android/installation/advanced-integration/), if you don't see a channel ID in the logs or encounter errors during initialization, review the following common problems and solutions. ## Initialization errors The Airship SDK fails during initialization or behaves unexpectedly in these cases: - `takeOff` has already been successfully called. - `takeOff` was called but the SDK was not configured through Autopilot or `airshipconfig.properties`. - Autopilot or `airshipconfig.properties` has invalid or missing credentials. - Required dependencies are missing from the `build.gradle` file. - `takeOff` was called before the application context was available. ## takeOff called multiple times If `takeOff` throws because it has already been successfully called, verify the following: - `takeOff` is only called once per app launch. - It's not called in both `Autopilot` and `Application.onCreate()`. ## Credential validation During initialization, the SDK checks only that credentials are present and correctly formatted in code, through `Autopilot`, or in `airshipconfig.properties`. It does not verify that the credentials are valid against Airship servers. If the configuration is valid and you initialize the SDK only once, initialization can complete without reporting an error even when the credentials themselves are invalid. The credentials the SDK uses at initialization, whether you call `takeOff` yourself or configure the SDK through `Autopilot` or `airshipconfig.properties`, are your Airship project's [App Key](https://www.airship.com/docs/reference/glossary/#app_key) and [App Secret](https://www.airship.com/docs/reference/glossary/#app_secret). To find them, select the dropdown menu () next to your project name, and then **Project details**. **Symptoms of missing or invalid credentials:** - No channel ID appears in the logs - Warnings or errors in the logs after initialization - Channel is not created in the Airship dashboard - Push notifications are not received If you are experiencing credential issues, do the following: 1. Compare your Airship project credentials with the values in your app, either in code, through `Autopilot`, or in `airshipconfig.properties`. - Credentials must match the expected format and character set. - Credentials must not be empty strings or contain extra whitespace. 1. Ensure both `productionAppKey`/`productionAppSecret` and `developmentAppKey`/`developmentAppSecret` are set in code, through `Autopilot`, or in `airshipconfig.properties` before the SDK initializes. **Guidelines for credentials:** - Use development credentials for development builds and production credentials for release builds. - Configure both development and production credentials in your app, either in code, through `Autopilot`, or in `airshipconfig.properties`. The SDK chooses which to use based on your build configuration. ## airshipconfig.properties not found or invalid If the SDK cannot load or parse `airshipconfig.properties`, or the file is invalid, verify the following: - The file exists in your app's `src/main/assets/` directory - The file name is exactly `airshipconfig.properties` - All required keys are present: `productionAppKey`, `productionAppSecret`, `developmentAppKey`, `developmentAppSecret` - The file format is valid (it must be in standard Java properties format) - The file is included in your build output ## FCM configuration issues If push notifications are not working or you need to confirm your FCM integration, verify the following: - The `google-services.json` file is configured for your app and Firebase project - The FCM dependency is included in your `build.gradle` file - The Google Services plugin is applied in your `build.gradle` file - The Firebase project is set up correctly in the Firebase Console # Troubleshooting Push Notifications > Check push notification status and fix common issues. If [push notifications](https://www.airship.com/docs/developer/sdk-integration/android/push-notifications/) aren't working as expected, you can check the notification status to diagnose the issue. The SDK provides detailed information about their current state. ## Get Current Notification Status Read the current notification status from `Airship.push.pushNotificationStatus` to inspect each field: #### Kotlin ```kotlin val status = Airship.push.pushNotificationStatus Log.d("Airship", "User notifications enabled: ${status.isUserNotificationsEnabled}") Log.d("Airship", "Notifications allowed: ${status.areNotificationsAllowed}") Log.d("Airship", "Privacy feature enabled: ${status.isPushPrivacyFeatureEnabled}") Log.d("Airship", "Push token registered: ${status.isPushTokenRegistered}") Log.d("Airship", "User opted in: ${status.isUserOptedIn}") Log.d("Airship", "Fully opted in: ${status.isOptIn}") ``` #### Java ```java PushNotificationStatus status = Airship.getPush().getPushNotificationStatus(); Log.d("Airship", "User notifications enabled: " + status.isUserNotificationsEnabled()); Log.d("Airship", "Notifications allowed: " + status.getAreNotificationsAllowed()); Log.d("Airship", "Privacy feature enabled: " + status.isPushPrivacyFeatureEnabled()); Log.d("Airship", "Push token registered: " + status.isPushTokenRegistered()); Log.d("Airship", "User opted in: " + status.isUserOptedIn()); Log.d("Airship", "Fully opted in: " + status.isOptIn()); ``` ## Listen for Status Changes Use the following to monitor notification status changes in real time: #### Kotlin ```kotlin scope.launch { Airship.push.pushNotificationStatusFlow.collect { status -> Log.d("Airship", "Notification status changed:") Log.d("Airship", "User opted in: ${status.isUserOptedIn}") Log.d("Airship", "Fully opted in: ${status.isOptIn}") } } ``` #### Java ```java Airship.getPush().addNotificationStatusListener(status -> { Log.d("Airship", "Notification status changed:"); Log.d("Airship", "User opted in: " + status.isUserOptedIn()); Log.d("Airship", "Fully opted in: " + status.isOptIn()); }); ``` ## Understanding Notification Status Fields The `NotificationStatus` class provides detailed information about why push might not be working: | Field | Description | |-------|-------------| | `isUserNotificationsEnabled` | Whether `pushManager.userNotificationsEnabled` is set to `true` | | `areNotificationsAllowed` | Whether the user has granted notification permissions | | `isPushPrivacyFeatureEnabled` | Whether the push privacy feature is enabled in `PrivacyManager` | | `isPushTokenRegistered` | Whether a push token has been successfully registered with FCM | | `isUserOptedIn` | `true` if user notifications are enabled, privacy feature is enabled, and notifications are allowed | | `isOptIn` | `true` if `isUserOptedIn` is `true` AND a push token is registered | ## Common Status Scenarios **Status:** `isUserNotificationsEnabled = false` - **Cause:** `pushManager.userNotificationsEnabled` has not been set to `true`. - **Solution:** Enable user notifications in your app code. **Status:** `areNotificationsAllowed = false` - **Cause:** User denied notification permissions or permissions not yet requested. (Android 13+) - **Solution:** Request notification permissions or guide user to system settings. **Status:** `isPushPrivacyFeatureEnabled = false` - **Cause:** Push privacy feature is disabled in Privacy Manager. - **Solution:** Enable the push privacy feature: `UAirship.shared().privacyManager.setEnabledFeatures(PrivacyManager.Feature.PUSH)`. **Status:** `isPushTokenRegistered = false` - **Cause:** Device hasn't received a push token from FCM yet. - **Solution:** Check network connectivity, FCM configuration, and device/emulator limitations. **Status:** `isUserOptedIn = true` but `isOptedIn = false` - **Cause:** Push token registration is pending or failed. - **Solution:** Check Logcat for FCM registration errors, verify network connectivity, and ensure proper FCM setup.