# Troubleshooting Initialization

Troubleshoot common initialization issues and apply solutions.

When following steps in [Getting Started](https://www.airship.com/docs/developer/sdk-integration/apple/installation/getting-started/) or [Advanced Integration](https://www.airship.com/docs/developer/sdk-integration/apple/installation/advanced-integration/), if you don't see a channel ID in the console logs or encounter errors during initialization, review the following common problems and solutions.

## takeOff errors

The `takeOff` method throws an error in these cases:

- `takeOff` has already been successfully called.
- `takeOff` was called without an `AirshipConfig` instance and the SDK could not load or parse `AirshipConfig.plist`.
- `takeOff` was called without an `AirshipConfig` instance and the parsed `AirshipConfig.plist` is invalid due to missing credentials.
- `takeOff` was called with an `AirshipConfig` instance that has an invalid config due to missing credentials.

## 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 `application(_:didFinishLaunchingWithOptions:)` and your App's `init()` method
- For SwiftUI apps, `takeOff` is called only in the App's `init()` method

## takeOff credentials

The `takeOff` method only validates that credentials are present and formatted correctly. It does not verify that the credentials are valid against Airship servers. If the config is properly set up and Airship is only called once, no error will be thrown even if the credentials themselves are invalid.

The credentials used by `takeOff` 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 console logs
- Warnings or errors in the logs after initialization
- Channel is not created in the Airship dashboard

If you are experiencing credential issues, do the following:

1. Compare your Airship project credentials with the values in your app, either in code or in `AirshipConfig.plist`.
   - 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 before calling `takeOff`.

**Guidelines for credentials:**
- Use development credentials for development builds and production credentials for release and TestFlight builds.
- Configure both development and production credentials in your app, either in code or in `AirshipConfig.plist`. The SDK chooses which to use based on your build configuration.

## AirshipConfig.plist not found or invalid

If `takeOff` fails because the SDK could not load or parse `AirshipConfig.plist`, or the plist is invalid, verify the following:
- The file exists in your app bundle
- The file is included in your target's Copy Bundle Resources build phase
- All required keys are present in the plist file: `productionAppKey`, `productionAppSecret`, `developmentAppKey`, and `developmentAppSecret`
- The plist file format is valid XML
