> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Install Gameball Flutter SDK v3.1.1

# Getting Started

## Requirements

* **Minimum Flutter Version**: 1.17.0
* **Dart**: 3.4.4+
* **Android**: API level 21+
* **iOS**: iOS 12.0+

## Install the SDK

Add the dependency to your `pubspec.yaml`:

```yaml theme={null}
dependencies:
  gameball_sdk: ^3.1.1
```

Then run:

```bash theme={null}
flutter pub get
```

## iOS Setup

Make sure your iOS deployment target is at least 12.0. In your `ios/Podfile`:

```ruby theme={null}
platform :ios, '12.0'
```

Run:

```bash theme={null}
cd ios && pod install
```

<Info>
  After updating the Podfile, run `pod install` to ensure all iOS dependencies are properly configured.
</Info>

## Android Setup

Ensure `INTERNET` permission is declared in `AndroidManifest.xml`:

```xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
```

Your `android/app/build.gradle` should have minimum SDK version 21:

```gradle theme={null}
android {
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34
    }
}
```

## Verify Installation

After installing, import the package in your Dart code to verify:

```dart theme={null}
import 'package:gameball_sdk/gameball_sdk.dart';
```

If there are no import errors, you're ready to initialize the SDK!

## Troubleshooting

### Common Issues

<AccordionGroup>
  <Accordion title="API Key Not Initialized Error">
    **Error:** `API key is not initialized. Call init() first`

    **Solution:** Ensure you call `gameballApp.init(config)` before any other SDK methods, preferably in your `main()` function before `runApp()`.
  </Accordion>

  <Accordion title="Invalid Customer ID Error">
    **Error:** `Customer ID cannot be empty`

    **Solution:** Provide a valid, non-empty customer ID in your requests. The customer ID should be a permanent identifier for the user.
  </Accordion>

  <Accordion title="Push Provider Validation Error">
    **Error:** `Device token is required when push provider is set`

    **Solution:** When setting a push provider, ensure you also provide a valid device token. Both must be set together.
  </Accordion>

  <Accordion title="Build Errors on iOS">
    **Symptoms:** Pod installation or build failures on iOS

    **Solutions:**

    * Clean build folder: `cd ios && xcodebuild clean`
    * Reinstall pods: `cd ios && pod install --repo-update`
    * Ensure iOS deployment target is at least 12.0
  </Accordion>

  <Accordion title="Build Errors on Android">
    **Symptoms:** Gradle build failures

    **Solutions:**

    * Clean gradle cache: `cd android && ./gradlew clean`
    * Verify minimum SDK version is 21 in `build.gradle`
    * Check React Native version compatibility
  </Accordion>
</AccordionGroup>

### Debug Logging

Enable Flutter's debug logging to see detailed SDK operation logs:

```bash theme={null}
flutter run --verbose
```

<Tip>
  For verbose logging during development, run your app with the `--verbose` flag to see detailed SDK logs and network operations.
</Tip>

## Next Steps

* [Initialize SDK](/installation-guides/v3/flutter/initialize-sdk)
* [Initialize Customer Profile](/installation-guides/v3/flutter/initialize-profile)
