Skip to content

Commit b8eaa84

Browse files
authored
feat: [Android] Use root project SDK. Update kotlin to 1.4.0 (#216)
1 parent 8e50ed7 commit b8eaa84

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

android/build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
kotlinVersion = '1.3.41'
3+
kotlinVersion = '1.4.0'
44
buildToolsVersion = '29.0.2'
55
compileSdkVersion = 29
66
targetSdkVersion = 29
@@ -26,13 +26,17 @@ def DEFAULT_COMPILE_SDK_VERSION = 28
2626
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
2727
def DEFAULT_TARGET_SDK_VERSION = 28
2828

29+
def safeExtGet(prop, fallback) {
30+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
31+
}
32+
2933
android {
30-
compileSdkVersion project.hasProperty('compileSdkVersion') ? project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
31-
buildToolsVersion project.hasProperty('buildToolsVersion') ? project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
34+
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
35+
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
3236

3337
defaultConfig {
3438
minSdkVersion 21
35-
targetSdkVersion project.hasProperty('targetSdkVersion') ? project.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
39+
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
3640
versionCode 1
3741
versionName "1.0"
3842
ndk {
@@ -54,6 +58,8 @@ def _kotlinVersion = _ext.has('detoxKotlinVersion') ? _ext.detoxKotlinVersion :
5458
def _kotlinStdlib = _ext.has('detoxKotlinStdlib') ? _ext.detoxKotlinStdlib : 'kotlin-stdlib-jdk8'
5559

5660
dependencies {
61+
implementation "androidx.core:core-ktx:1.0.1"
62+
5763
implementation 'com.facebook.react:react-native:+'
5864

5965
implementation "org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinVersion"

android/src/main/java/com/vydia/RNUploader/NotificationActionsReceiver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class NotificationActionsReceiver : BroadcastReceiver() {
2121
}
2222

2323
if (NotificationActions().ACTION_CANCEL_UPLOAD == intent.getStringExtra(NotificationActions().PARAM_ACTION)) {
24-
onUserRequestedUploadCancellation(context!!, intent.getStringExtra(NotificationActions().PARAM_UPLOAD_ID))
24+
onUserRequestedUploadCancellation(context!!, intent.getStringExtra(NotificationActions().PARAM_UPLOAD_ID)!!)
2525
}
2626
}
2727

0 commit comments

Comments
 (0)