Skip to content

Commit 58b72ec

Browse files
author
Emiliano Botti
committed
Android & Kotlin upgrade working
1 parent 469c76a commit 58b72ec

File tree

3 files changed

+23
-33
lines changed

3 files changed

+23
-33
lines changed

README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Inside your `AppDelegate.m`, setup the line sdk by passing the channel id obtain
6868
//
6969
// Import the Library
7070
//
71-
@import RNLine;
71+
#import "RNLine-Swift.h"
7272

7373
//
7474
// Setup the plugin using your CHANNEL_ID when the app finishes launching
@@ -135,22 +135,7 @@ Don't forget to add `application` function, as line's instructions indicate.
135135
```
136136

137137
3. Add `minSdkVersion = 17` in `android/build.gradle`
138-
4. Add LineSDK as a dependency in `android/build.gradle`
139-
```gradle
140-
android {
141-
// Enable Java 1.8 support.
142-
compileOptions { // <- add this block if didn't setup
143-
sourceCompatibility JavaVersion.VERSION_1_8
144-
targetCompatibility JavaVersion.VERSION_1_8
145-
}
146-
...
147-
dependencies {
148-
...
149-
implementation 'com.linecorp.linesdk:linesdk:5.7.0' // <- add this line
150-
}
151-
}
152-
```
153-
5. In your manifest add `xmlns:tools="http://schemas.android.com/tools"` in your `manifest` tag and also `tools:replace="android:allowBackup"` in your `application` tag
138+
4. In your manifest add `xmlns:tools="http://schemas.android.com/tools"` in your `manifest` tag and also `tools:replace="android:allowBackup"` in your `application` tag
154139

155140
## API
156141

android/build.gradle

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
buildscript {
22
//Buildscript is evaluated before everything else so we can't use getExtOrDefault
3-
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeLine_kotlinVersion']
43
ext {
5-
buildToolsVersion = "30.0.2"
6-
minSdkVersion = 21
7-
compileSdkVersion = 28
8-
targetSdkVersion = 30
4+
kotlinVersion = rootProject.ext.has('kotlinVersion')
5+
? rootProject.ext.get('kotlinVersion')
6+
: project.properties['ReactNativeLine_kotlinVersion']
7+
8+
buildToolsVersion = project.properties['ReactNativeLine_buildToolsVersion']
9+
minSdkVersion = project.properties['ReactNativeLine_minSdkVersion']
10+
compileSdkVersion = project.properties['ReactNativeLine_compileSdkVersion']
11+
targetSdkVersion = project.properties['ReactNativeLine_targetSdkVersion']
912
coroutinesAndroidVersion = "1.0.1"
1013
coroutinesCoreVersion = "1.0.1"
1114
gsonVersion = "2.8.6"
12-
linesdkVersion = "5.7.0"
15+
linesdkVersion = project.properties['ReactNativeLine_lineSdkVersion']
1316
}
1417
repositories {
1518
google()
16-
jcenter()
19+
mavenCentral()
1720
}
1821

1922
dependencies {
20-
classpath "com.android.tools.build:gradle:3.5.1"
23+
classpath "com.android.tools.build:gradle:7.0.4"
2124
//noinspection DifferentKotlinGradleVersion
22-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
25+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
2326
}
2427
}
2528

@@ -38,7 +41,7 @@ def safeExtGet(prop, fallback) {
3841
}
3942

4043
android {
41-
compileSdkVersion safeExtGet("compileSdkVersion", 28)
44+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
4245

4346
defaultConfig {
4447
minSdkVersion safeExtGet('minSdkVersion', 21)
@@ -56,9 +59,10 @@ android {
5659
}
5760

5861
dependencies {
62+
//noinspection GradleDynamicVersion from node modules
5963
implementation "com.facebook.react:react-native:+"
60-
implementation 'com.linecorp.linesdk:linesdk:5.7.0'
61-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.50"
64+
implementation "com.linecorp.linesdk:linesdk:5.8.0"
65+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
6266
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesAndroidVersion"
6367
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesCoreVersion"
6468
}

android/gradle.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
ReactNativeLine_kotlinVersion=1.3.50
1+
ReactNativeLine_kotlinVersion=1.7.21
22
ReactNativeLine_compileSdkVersion=28
3-
ReactNativeLine_buildToolsVersion=28.0.3
4-
ReactNativeLine_targetSdkVersion=28
5-
ReactNativeLine_lineSdkVersion=5.7.0
3+
ReactNativeLine_minSdkVersion=21
4+
ReactNativeLine_buildToolsVersion=30.0.2
5+
ReactNativeLine_targetSdkVersion=30
6+
ReactNativeLine_lineSdkVersion=5.8.0

0 commit comments

Comments
 (0)