> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/mobile/react-native/android-setup.md).

# Android Setup

{% hint style="danger" %}
This SDK is deprecated and will receive limited support. Please adopt the v10 SDK: [https://github.com/smileidentity/docs/blob/main/mobile/react-native/broken-reference/README.md](https://github.com/smileidentity/docs/blob/main/mobile/react-native/broken-reference/README.md "mention")
{% endhint %}

### Supported Versions

Minimum supported version is android 4.4 api 19

Maximum supported version is android 13 api 33

## Gradle Integration

This is best done in Android Studio but if not installed can be done by looking at the android folder of your react native project

1\. In your root-level (project-level) Gradle file (`build.gradle`), add rules to include the Maven Central repository.

```
buildscript {​
        repositories {
        mavenCentral() // add the maven central repository
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
          }
   }
}
```

2\. In your module (app-level) Gradle file (usually `app/build.gradle`), apply the Smile ID android plugin:

```
apply plugin: 'com.smileidentity.smile-id-android'
```

3\. Declare the Smile ID android SDK in your **root level Gradle file** (usually `build.gradle`).

```
dependencies {
classpath group: 'com.smileidentity', name: 'smile-id-android', version: '1.0.1'
}
```

### Android Manifest

#### Permissions

Add the following permissions if they do not exist already

```
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
```

#### Activities

Add the following activities under the application tag

```
 <!--id capture-->
<activity android:name="com.smileid.smileidui.SIDIDCaptureActivity" />
<!--selfie capture-->
<activity android:name="com.smileid.smileidui.SIDSelfieCaptureActivity" />
<!--selfie review screen-->
<activity android:name="com.smileid.smileidui.SIDReviewActivity" />
```

That's it android is ready!

### Smile Config

Place the file you downloaded from the portal as specified [here](/integration-options/mobile/flutter.md) in the android/app folder

That's it android is ready!

### Common Errors

### Execution failed for task ':app:mergeDebugJavaResource'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'META-INF/DEPENDENCIES'.

To resolve this error add this to your android section under android

```
packagingOptions {
    exclude 'META-INF/androidx.*'
    exclude 'androidx.*'
    exclude 'META-INF/DEPENDENCIES'
}
```

### An issue with local.properties

You will have to add the local.properties to your root android project

## Trouble Shooting

If you get an error as below \\

### Execution failed for task ':app:mergeDebugJavaResource'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'META-INF/DEPENDENCIES'.

The solution is to add this to your module level build.gradle\\

```
android {
....
    packagingOptions {
        exclude 'META-INF/androidx.*'
        exclude 'androidx.*'
        exclude 'META-INF/DEPENDENCIES'
    }
....
}
```

### Manifest merger failed : Attribute application\@label value=xxx

Solution is to add the below to your AndroidManifest.xml\\

```
<application
...
tools:replace="android:label"
.../>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/mobile/react-native/android-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
