Skip to main content

Android Installation

Requirements​

  • Android API 24 (Android 7.0) minimum
  • JDK 17
  • Gradle 8.x
  • JitPack in your repository list

1 — Add JitPack repository​

The library depends on UCrop which is hosted on JitPack. Add JitPack to your root android/build.gradle:

android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}

:::note Gradle 7+ settings-based repo config If your project uses dependencyResolutionManagement in android/settings.gradle instead of allprojects, add JitPack there:

android/settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}

:::

2 — Declare editor activities​

The editor opens a full-screen Activity. Declare both activities in your app's AndroidManifest.xml:

android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application ...>

<!-- Photo editor activity -->
<activity
android:name="com.ahmedadeltito.photoeditor.PhotoEditorActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />

<!-- Crop activity (UCrop) -->
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />

</application>
</manifest>

:::caution Missing activity declarations = crash on launch If either activity is missing from the manifest, Android will throw an ActivityNotFoundException as soon as the editor tries to open. :::

3 — JDK 17​

The library's Android module is compiled with sourceCompatibility JavaVersion.VERSION_17. Make sure your Android Gradle build is using JDK 17.

Check your current JDK version:

java -version

If you're using Android Studio, set the Gradle JDK to 17 in File → Settings → Build, Execution, Deployment → Build Tools → Gradle → Gradle JDK.

4 — Verify​

Run on a connected device or emulator:

npx react-native run-android

If you see a NoClassDefFoundError crash on the first button tap, see Troubleshooting → Android.

SDK version overrides​

The library reads SDK versions from your root project's ext block with sensible fallbacks. You can override any of them:

android/build.gradle
ext {
compileSdkVersion = 35
buildToolsVersion = "35.0.0"
minSdkVersion = 24
targetSdkVersion = 35
}

Dependencies pulled in​

These are resolved automatically and do not need to be added manually:

DependencyVersionPurpose
com.facebook.react:react-native+React Native bridge
com.google.android.material:material1.9.0Material UI components
androidx.appcompat:appcompat1.6.1AppCompat base
androidx.constraintlayout:constraintlayout2.1.4Layout
com.github.yalantis:ucrop2.2.2-nativeCrop UI (from JitPack)
androidx.exifinterface:exifinterface1.3.7EXIF orientation handling
fr.avianey.com.viewpagerindicator:library2.4.1Sticker/emoji tab indicator