Troubleshooting Initialization
Troubleshoot common initialization issues and apply solutions.
When following steps in Getting Started or 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:
takeOffhas already been successfully called.takeOffwas called but the SDK was not configured through Autopilot orairshipconfig.properties.- Autopilot or
airshipconfig.propertieshas invalid or missing credentials. - Required dependencies are missing from the
build.gradlefile. takeOffwas called before the application context was available.
takeOff called multiple times
If takeOff throws because it has already been successfully called, verify the following:
takeOffis only called once per app launch.- It’s not called in both
AutopilotandApplication.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 KeyThe unique identifier for your Airship project. It is used to authenticate the application for API calls. and App SecretA secret used to authorize requests for low-security API calls. It is intended to be embedded in your distributed application, and as such is limited in what it can do.. 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:
- Compare your Airship project credentials with the values in your app, either in code, through
Autopilot, or inairshipconfig.properties.- Credentials must match the expected format and character set.
- Credentials must not be empty strings or contain extra whitespace.
- Ensure both
productionAppKey/productionAppSecretanddevelopmentAppKey/developmentAppSecretare set in code, throughAutopilot, or inairshipconfig.propertiesbefore 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 inairshipconfig.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.jsonfile is configured for your app and Firebase project - The FCM dependency is included in your
build.gradlefile - The Google Services plugin is applied in your
build.gradlefile - The Firebase project is set up correctly in the Firebase Console