Skip to content

Commit a74d30d

Browse files
committed
Add version 2.13.0
1 parent 645db84 commit a74d30d

File tree

5 files changed

+76
-41
lines changed

5 files changed

+76
-41
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [2.13.0]
2+
3+
### Changed
4+
5+
* 🚨 With this version you might need to create symlinks when using Android Gradle Plugin version `4.x`. Please refer to the new [known issues](https://github.com/imgly/vesdk-react-native#known-issues) section of the README for details.
6+
* 🚨 This version requires `minSdkVersion` `21` for Android. Please refer to the new step 3 in the [getting started](https://github.com/imgly/vesdk-react-native#android) section of the README for instructions on how to adjust it.
7+
* [react-native-videoeditorsdk] Raised minimum VideoEditor SDK for Android version to 10.0.1. See the [changelog](https://github.com/imgly/vesdk-android-demo/blob/master/CHANGELOG.md) for more information.
8+
* [react-native-photoeditorsdk] Raised minimum PhotoEditor SDK for Android version to 10.0.1. See the [changelog](https://github.com/imgly/pesdk-android-demo/blob/master/CHANGELOG.md) for more information.
9+
10+
### Added
11+
12+
* [react-native-imglysdk] Added support to specify a custom `buildToolsVersion`, `minSdkVersion`, `compileSdkVersion`, `targetSdkVersion`, and `kotlinGradlePluginVersion` for Android with the Expo config plugin.
13+
114
## [2.12.0]
215

316
### Changed

README.md

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@ Check out our [video tutorial](https://img.ly/blog/a-photo-and-video-editor-for-
2121

2222
## Getting started
2323

24+
### Known Issues
25+
26+
With version `2.13.0`, we recommend using `compileSdkVersion` not lower than `31.0.0` for Android. However, this might interfere with your application's Android Gradle Plugin version if this is set to `4.x`.
27+
28+
If you don't use a newer Android Gradle Plugin version, e.g., by updating at least to RN 0.68.0, you'll most likely encounter a build error similar to:
29+
```
30+
FAILURE: Build failed with an exception.
31+
32+
* What went wrong:
33+
A problem occurred configuring project ':react-native-photoeditorsdk'.
34+
> com.android.builder.errors.EvalIssueException: Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
35+
36+
* Try:
37+
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
38+
39+
* Get more help at https://help.gradle.org
40+
```
41+
As a workaround you can create the following symlinks:
42+
1. Inside `/Users/YOUR-USERNAME/Library/Android/sdk/build-tools/31.0.0/`: Create a `dx` symlink for the `d8` file with `ln -s d8 dx`.
43+
2. From there, go to `./lib/` and create a `dx.jar` symlink for the `d8.jar` file with `ln -s d8.jar dx.jar`.
44+
2445
### Expo CLI
2546

2647
#### Limitations
@@ -47,7 +68,7 @@ In order to use this module with the Expo CLI you can make use of our integrated
4768
}
4869
```
4970

50-
If needed, you can also use a specific version of our native library for Android as well as define explicitly the included modules. By default, all modules for both PhotoEditor SDK and VideoEditor SDK are included.
71+
If needed, you can also use a specific version of our native library for Android as well as define explicitly the included modules. By default, all modules for both PhotoEditor SDK and VideoEditor SDK are included. Furthermore, you can configure the `buildToolsVersion`, `minSdkVersion`, `compileSdkVersion`, `targetSdkVersion`, and `kotlinGradlePluginVersion`.
5172

5273
```json
5374
{
@@ -56,13 +77,18 @@ In order to use this module with the Expo CLI you can make use of our integrated
5677
"react-native-imglysdk",
5778
{
5879
"android": {
59-
"version": "9.2.0",
80+
"version": "10.0.1",
6081
"modules": [
6182
"ui:core",
6283
"ui:transform",
6384
"ui:filter",
6485
"assets:filter-basic"
65-
]
86+
],
87+
"buildToolsVersion": "31.0.0",
88+
"minSdkVersion": "21",
89+
"compileSdkVersion": "31",
90+
"targetSdkVersion": "30",
91+
"kotlinGradlePluginVersion": "1.5.32"
6692
}
6793
}
6894
]
@@ -114,40 +140,22 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
114140

115141
#### Android
116142

117-
1. Because PhotoEditor SDK for Android is quite large, there is a high chance that you will need to enable [Multidex](https://developer.android.com/studio/build/multidex) for your project as follows:
118-
119-
1. Open the `android/app/build.gradle` file (**not** `android/build.gradle`) and add these lines at the end:
120-
```groovy
121-
android {
122-
defaultConfig {
123-
multiDexEnabled true
124-
}
125-
}
126-
dependencies {
127-
implementation 'androidx.multidex:multidex:2.0.1'
128-
}
129-
```
130-
2. Open the `android/app/src/main/java/.../MainApplication.java` file and change the superclass of your `MainApplication` class from `Application` to `androidx.multidex.MultiDexApplication`, e.g.:
131-
```java
132-
public class MainApplication extends androidx.multidex.MultiDexApplication implements ReactApplication {
133-
```
134-
135-
2. Add the img.ly repository and plugin by opening the `android/build.gradle` file (**not** `android/app/build.gradle`) and adding these lines at the top:
143+
1. Add the img.ly repository and plugin by opening the `android/build.gradle` file (**not** `android/app/build.gradle`) and adding these lines at the top:
136144
```groovy
137145
buildscript {
138146
repositories {
139147
mavenCentral()
140148
maven { url "https://artifactory.img.ly/artifactory/imgly" }
141149
}
142150
dependencies {
143-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
144-
classpath 'ly.img.android.sdk:plugin:9.2.0'
151+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.32"
152+
classpath 'ly.img.android.sdk:plugin:10.0.1'
145153
}
146154
}
147155
```
148-
In order to update PhotoEditor SDK for Android replace the version string `9.2.0` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
156+
In order to update PhotoEditor SDK for Android replace the version string `10.0.1` with a [newer release](https://github.com/imgly/pesdk-android-demo/releases).
149157

150-
3. Still in the `android/build.gradle` file (**not** `android/app/build.gradle`), add these lines at the bottom:
158+
2. Still in the `android/build.gradle` file (**not** `android/app/build.gradle`), add these lines at the bottom:
151159

152160
```groovy
153161
allprojects {
@@ -157,6 +165,22 @@ For older React Native versions autolinking is not available and PhotoEditor SDK
157165
}
158166
```
159167

168+
3. In the same file, you will need to modify the `minSdkVersion` to at least `21`. We also recommend to update the `buildToolsVersion` to `31.0.0` or higher as well as the `compileSdkVersion` to `31` or higher:
169+
170+
```diff
171+
buildscript {
172+
ext {
173+
- buildToolsVersion = "30.0.2"
174+
+ buildToolsVersion = "31.0.0"
175+
- minSdkVersion = 19
176+
+ minSdkVersion = 21
177+
- compileSdkVersion = 30
178+
+ compileSdkVersion = 31
179+
targetSdkVersion = 30
180+
}
181+
}
182+
```
183+
160184
4. Configure PhotoEditor SDK for Android by opening the `android/app/build.gradle` file (**not** `android/build.gradle`) and adding the following lines under `apply plugin: "com.android.application"`:
161185
```groovy
162186
apply plugin: 'ly.img.android.sdk'

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ imglyConfig {
2020
}
2121
}
2222

23-
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "9.2.0"
23+
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.0.1"
2424

2525
task checkVersion {
2626
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {
@@ -39,11 +39,11 @@ task checkVersion {
3939
preBuild.dependsOn checkVersion
4040

4141
android {
42-
compileSdkVersion safeExtGet('compileSdkVersion', 30)
43-
buildToolsVersion safeExtGet('buildToolsVersion', '30.0.3')
42+
compileSdkVersion safeExtGet('compileSdkVersion', 31)
43+
buildToolsVersion safeExtGet('buildToolsVersion', '31.0.0')
4444

4545
defaultConfig {
46-
minSdkVersion safeExtGet('minSdkVersion', 19)
46+
minSdkVersion safeExtGet('minSdkVersion', 21)
4747
targetSdkVersion safeExtGet('targetSdkVersion', 30)
4848
versionCode 1
4949
versionName "1.0"

android/src/main/java/ly/img/react_native/pesdk/RNPhotoEditorSDKModule.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package ly.img.react_native.pesdk
22

33
import android.app.Activity
44
import android.content.Intent
5-
import android.content.pm.PackageManager
65
import android.net.Uri
76
import android.util.Log
87
import com.facebook.react.bridge.*
@@ -40,7 +39,6 @@ class RNPhotoEditorSDKModule(val reactContext: ReactApplicationContext) : ReactC
4039

4140
}
4241

43-
private var currentSettingsList: PhotoEditorSettingsList? = null
4442
private var currentPromise: Promise? = null
4543
private var currentConfig: Configuration? = null
4644

@@ -69,9 +67,9 @@ class RNPhotoEditorSDKModule(val reactContext: ReactApplicationContext) : ReactC
6967
val resultPath = data.resultUri
7068

7169
val serializationConfig = currentConfig?.export?.serialization
72-
val settingsList = data.settingsList
7370

7471
val serialization: Any? = if (serializationConfig?.enabled == true) {
72+
val settingsList = data.settingsList
7573
skipIfNotExists {
7674
settingsList.let { settingsList ->
7775
if (serializationConfig.embedSourceImage == true) {
@@ -100,6 +98,7 @@ class RNPhotoEditorSDKModule(val reactContext: ReactApplicationContext) : ReactC
10098
Log.i("ImgLySdk", "You need to include 'backend:serializer' Module, to use serialisation!")
10199
null
102100
}
101+
settingsList.release()
103102
} else {
104103
null
105104
}
@@ -133,12 +132,10 @@ class RNPhotoEditorSDKModule(val reactContext: ReactApplicationContext) : ReactC
133132
fun present(image: String?, config: ReadableMap?, serialization: String?, promise: Promise) {
134133
IMGLY.authorize()
135134

136-
val settingsList = PhotoEditorSettingsList()
137-
138-
currentSettingsList = settingsList
139-
currentConfig = ConfigLoader.readFrom(config?.toHashMap() ?: mapOf()).also {
140-
it.applyOn(settingsList)
141-
}
135+
val configuration = ConfigLoader.readFrom(config?.toHashMap() ?: mapOf())
136+
val settingsList = PhotoEditorSettingsList(configuration.export?.serialization?.enabled == true)
137+
configuration.applyOn(settingsList)
138+
currentConfig = configuration
142139
currentPromise = promise
143140

144141
settingsList.configure<LoadSettings> { loadSettings ->
@@ -178,6 +175,7 @@ class RNPhotoEditorSDKModule(val reactContext: ReactApplicationContext) : ReactC
178175
PhotoEditorBuilder(currentActivity)
179176
.setSettingsList(settingsList)
180177
.startActivityForResult(currentActivity, EDITOR_RESULT_ID)
178+
settingsList.release()
181179
}()
182180
}
183181
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-photoeditorsdk",
33
"title": "React Native module for PhotoEditor SDK",
4-
"version": "2.12.0",
4+
"version": "2.13.0",
55
"description": "A React Native module for PhotoEditor SDK. Integrate the photo editor into your own HTML5, iOS or Android app - in minutes!",
66
"main": "index.js",
77
"typings": "index.d.ts",
@@ -38,6 +38,6 @@
3838
"react-native": ">=0.60.0 <1.0.x"
3939
},
4040
"dependencies": {
41-
"react-native-imglysdk": "2.12.0"
41+
"react-native-imglysdk": "2.13.0"
4242
}
4343
}

0 commit comments

Comments
 (0)