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

# Installation

# Installation

This guide covers installing the Privacy Boost Android SDK in your project.

## Requirements

* Android API 21+ (Android 5.0 Lollipop)
* Kotlin 1.8+
* Android Studio Arctic Fox (2020.3.1) or later

## Gradle Setup

### Kotlin DSL (build.gradle.kts)

Add the dependency to your app's `build.gradle.kts`:

```kotlin theme={null}
dependencies {
    implementation("io.privacy-boost:privacy-boost-android:1.0.0")
}
```

### Groovy DSL (build.gradle)

```groovy theme={null}
dependencies {
    implementation 'io.privacy-boost:privacy-boost-android:1.0.0'
}
```

### Repository Configuration

If not using Maven Central, add the repository:

```kotlin theme={null}
// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        // Or custom repository
        maven {
            url = uri("https://maven.privacy-boost.io/releases")
        }
    }
}
```

## ProGuard/R8 Rules

The SDK includes consumer ProGuard rules. If you need custom rules:

```proguard theme={null}
# Keep SDK classes
-keep class com.privacyboost.sdk.** { *; }

# Keep UniFFI generated code
-keep class uniffi.** { *; }
```

## Native Library Loading

The SDK includes native libraries for multiple architectures:

* `armeabi-v7a`
* `arm64-v8a`
* `x86`
* `x86_64`

To reduce APK size, use ABI splits:

```kotlin theme={null}
android {
    splits {
        abi {
            isEnable = true
            reset()
            include("armeabi-v7a", "arm64-v8a", "x86_64")
            isUniversalApk = false
        }
    }
}
```

Or use App Bundles (recommended):

```kotlin theme={null}
android {
    bundle {
        abi {
            enableSplit = true
        }
    }
}
```

## Verifying Installation

Create a test to verify the SDK loads correctly:

```kotlin theme={null}
import com.privacyboost.sdk.*

class SDKTest {
    @Test
    fun testSDKInitialization() {
        val config = PrivacyBoostConfig(
            serverUrl = "https://optimism.sepolia.privacyboost.io",
            wethContractAddress = "0x...",
            appId = "app_abc123xyz"
        )

        val sdk = PrivacyBoost(config)
        assertNotNull(sdk)
        assertFalse(sdk.isConnected())
    }
}
```

## Permissions

Add required permissions to `AndroidManifest.xml`:

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

For Keystore access (optional):

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

## Troubleshooting

### UnsatisfiedLinkError

If you see native library loading errors:

1. Ensure the correct architecture is included
2. Check that the AAR is properly unpacked
3. Try cleaning and rebuilding: `./gradlew clean build`

### Dependency Conflicts

If you have Kotlin coroutines version conflicts:

```kotlin theme={null}
configurations.all {
    resolutionStrategy {
        force("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
    }
}
```

### Multidex

For API \< 21 or large apps, enable multidex:

```kotlin theme={null}
android {
    defaultConfig {
        multiDexEnabled = true
    }
}

dependencies {
    implementation("androidx.multidex:multidex:2.0.1")
}
```

## Next Steps

* [Getting Started](./getting-started) - Initialize and use the SDK
* [Wallet Integration](./guides/wallet-integration) - Implement wallet delegate
