Skip to main content
The PayMaya Android SDK v2 is distributed through JitPack, making it easy to add to your Android project with Gradle.

Prerequisites

Before installing the SDK, ensure you have:
  • Android Studio (latest stable version recommended)
  • An Android project with minimum SDK version 23 (Android 6.0)
  • A PayMaya account with API keys (sign up here)

Installation Steps

1

Add JitPack Repository

Open your project’s root build.gradle file and add the JitPack repository to the allprojects section:
build.gradle
allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
If you’re using newer Android projects with settings.gradle, add the repository there instead:
settings.gradle
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
2

Add SDK Dependency

Open your app module’s build.gradle file and add the PayMaya SDK dependency:
build.gradle (app module)
dependencies {
    implementation 'com.github.paymaya:paymaya-android-sdk-v2:2.5.0'
    
    // Your other dependencies
}
Check JitPack releases for the latest version number.
3

Sync Gradle

Click Sync Now in the banner that appears in Android Studio, or run:
./gradlew sync
4

Verify Installation

To verify the SDK is installed correctly, add an import statement in your Activity or Fragment:
import com.paymaya.sdk.android.checkout.PayMayaCheckout
import com.paymaya.sdk.android.common.PayMayaEnvironment
If the import resolves without errors, the installation was successful.

Version Tags

The PayMaya Android SDK follows semantic versioning. Use the release tags from the GitHub repository:
// Latest stable version
implementation 'com.github.paymaya:paymaya-android-sdk-v2:2.5.0'

// Specific version
implementation 'com.github.paymaya:paymaya-android-sdk-v2:2.4.0'

// Latest from a branch (not recommended for production)
implementation 'com.github.paymaya:paymaya-android-sdk-v2:master-SNAPSHOT'
Always use a specific version tag in production. Avoid using + or SNAPSHOT versions as they may introduce breaking changes.

JCenter Deprecation Notice

Important: JCenter support has been deprecated. Only versions 2.0.1 and below are available in JCenter as read-only.
If you were previously using JCenter, migrate to JitPack:
repositories {
    jcenter()
}

dependencies {
    implementation 'com.paymaya:paymaya-sdk-android:+'
}

ProGuard Configuration

If you’re using ProGuard or R8 for code obfuscation, the SDK is already configured with consumer ProGuard rules. No additional configuration is needed.

Troubleshooting

Gradle Sync Issues

If you encounter Gradle sync errors:
  1. Check your internet connection - JitPack downloads dependencies from GitHub
  2. Clear Gradle cache:
    ./gradlew clean
    rm -rf ~/.gradle/caches/
    
  3. Verify repository URL - Ensure https://jitpack.io is correctly added
  4. Check version tag - Verify the version exists on JitPack

Minimum SDK Version Conflict

If you see a minimum SDK version error:
build.gradle (app module)
android {
    defaultConfig {
        minSdkVersion 23  // Must be 23 or higher
        targetSdkVersion 33
    }
}

Dependency Conflicts

If you encounter dependency conflicts with other libraries:
dependencies {
    implementation('com.github.paymaya:paymaya-android-sdk-v2:2.5.0') {
        exclude group: 'conflicting-group', module: 'conflicting-module'
    }
}

Next Steps

Now that you have the SDK installed, you’re ready to integrate payments:

Quick Start Guide

Learn how to process your first payment

Build docs developers (and LLMs) love