Skip to content

Commit

Permalink
Merge pull request #5 from getyoti/YD-2369
Browse files Browse the repository at this point in the history
[YD-2369] Bump up YDS Android SDK libraries to 2.3.2 & YDS RN to 1.2.1
  • Loading branch information
mariasenosiain authored Aug 6, 2020
2 parents 5e02716 + b13475e commit 8edb06f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 32 deletions.
75 changes: 49 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If you're using CocoaPods, navigate to your `ios` and update your `Podfile`:

```diff
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
+ `pod 'react-native-yoti-doc-scan', :path => '../node_modules/react-native-yoti-doc-scan/react-native-yoti-doc-scan.podspec'`
+ `pod 'react-native-yoti-doc-scan', :path => '../node_modules/react-native-yoti-doc-scan/react-native-yoti-doc-scan.podspec'`
end
```

Expand All @@ -50,13 +50,13 @@ If autolinking fails, refer to the [troubleshooting instructions](#troubleshooti

Add microblink to your repositories in the root build.gradle file (`android/build.gradle`):

```diff
```groovy
allprojects {
repositories {
+ mavenCentral()
+ maven { url 'https://maven.microblink.com' }
+ maven { url "https://jitpack.io" }
...
mavenCentral()
maven { url 'https://maven.microblink.com' }
maven { url "https://jitpack.io" }
...
}
...
}
Expand All @@ -65,37 +65,60 @@ allprojects {

Add this configuration for the debug build type to your `buildTypes` block (`android/app/build.gradle`):

```diff
```groovy
buildTypes {
debug {
+ matchingFallbacks = ['release']
matchingFallbacks = ['release']
...
}
...
}
```
If you're using [Firebase Performance Monitoring](https://rnfirebase.io/perf/usage) you'll need to disable it for debug built variant. One way to do this is including this flag in your `gradle.properties` file:

```groovy
firebasePerformanceInstrumentationEnabled=false
```
And update your release build command line to enable it:

```groovy
./gradlew assembleRelease -PfirebasePerformanceInstrumentationEnabled=true
```

### Release build configuration
If you're using **Proguard** or other obfuscation tool, add the following configuration rules to your proguard-rules.pro file:
```groovy
-keep class com.yoti.** { *; }
-keep class com.microblink.** { *; }
-keep class com.microblink.**$* { *; }
-dontwarn com.microblink.**
-keep class com.facetec.zoom.** { *; }
-dontwarn javax.annotation.Nullable
```


Depending on your Android project setup and version of React Native, you
may encounter the following error during your build process:

> More than one files produce libc++_shared.so
Resolve by adding the following packaging options to your `android` block (`android/app/build.gradle`):

```diff
```groovy
android {
compileSdkVersion rootProject.ext.compileSdkVersion
+ packagingOptions {
+ pickFirst 'lib/x86/libc++_shared.so'
+ pickFirst 'lib/x86_64/libjsc.so'
+ pickFirst 'lib/arm64-v8a/libjsc.so'
+ pickFirst 'lib/arm64-v8a/libc++_shared.so'
+ pickFirst 'lib/x86_64/libc++_shared.so'
+ pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+ }

packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libjsc.so'
pickFirst 'lib/arm64-v8a/libjsc.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
...
```
Expand Down Expand Up @@ -170,10 +193,10 @@ Android linking is performed in 3 steps:
Add the following to your settings.gradle file as a new entry before the last line which has `include ':app'`:
```diff
+ include ':react-native-yoti-doc-scan'
+ project(':react-native-yoti-doc-scan').projectDir = new
+ File(rootProject.projectDir, '../node_modules/react-native-yoti-doc-scan/src/android')
```groovy
include ':react-native-yoti-doc-scan'
project(':react-native-yoti-doc-scan').projectDir = new
File(rootProject.projectDir, '../node_modules/react-native-yoti-doc-scan/src/android')
include ':app'
```
Expand All @@ -182,17 +205,17 @@ Add the following to your settings.gradle file as a new entry before the last li
Find the `dependencies` block in your build.gradle file and add `implementation project(':react-native-yoti-doc-scan')`:
```diff
```groovy
dependencies {
...
+ implementation project(':react-native-yoti-doc-scan')
...
implementation project(':react-native-yoti-doc-scan')
}
```
#### android/app/src/main/java/..../MainApplication.java
Add an import for the package:
Add this import for the package:
```diff
import android.app.Application;
Expand Down
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 29)
versionCode 120
versionName "1.2.0"
versionCode 121
versionName "1.2.1"
ndk {
abiFilters "armeabi-v7a", "x86"
}
Expand All @@ -38,8 +38,8 @@ android {
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation 'com.yoti.mobile.android.sdk:yoti-sdk-doc-scan:2.3.0'
implementation 'com.yoti.mobile.android.sdk:yoti-sdk-liveness-zoom:2.3.0'
implementation 'com.yoti.mobile.android.sdk:yoti-sdk-doc-scan:2.3.2'
implementation 'com.yoti.mobile.android.sdk:yoti-sdk-liveness-zoom:2.3.2'
}

allprojects {
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
def enableProguardInReleaseBuilds = true

/**
* The preferred build flavor of JavaScriptCore.
Expand Down
6 changes: 6 additions & 0 deletions example/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:
-keep class com.yoti.** { *; }
-keep class com.microblink.** { *; }
-keep class com.microblink.**$* { *; }
-dontwarn com.microblink.**
-keep class com.facetec.zoom.** { *; }
-dontwarn javax.annotation.Nullable
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getyoti/react-native-yoti-doc-scan",
"version": "1.2.0",
"version": "1.2.1",
"description": "Yoti Doc Scan for React Native",
"main": "YotiDocScan.js",
"license": "SEE LICENSE IN LICENSE",
Expand Down

0 comments on commit 8edb06f

Please sign in to comment.