Skip to content

Commit fcbbb16

Browse files
Upgrade of React-Native and Dependencies for Gradle 8 and Kotlin 1.8.0 Compatibility (#174)
* Upgraded React-Native to 0.73.4 in the example. * Upgraded React-Native to 0.73.4 & dependencies in the Android. * Updated config.yml * Fixed compile issue * Lint fix * Lint fix * Removed yarn.lock * Tried fixing missing imports * Tried fixing CI * Tried fixing CI * Tried fixing CI * Tried fixing CI * Updated dependencies
1 parent c2d0a56 commit fcbbb16

25 files changed

+41570
-9090
lines changed

Diff for: .circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
# Default VM config to be used for macOS builds
44
macos_config: &macos_config
55
macos:
6-
xcode: 14.0.0
6+
xcode: 15.0.0
77
resource_class: macos.x86.medium.gen2
88
shell: /bin/bash --login -eo pipefail
99

Diff for: android/build.gradle

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
def packageJsonFile = file('../package.json')
2-
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3-
def packageVersion = '"' + packageJson.version + '"'
1+
def packageJsonFile = file('../package.json')
2+
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3+
def packageVersion = '"' + packageJson.version + '"'
44

55

66
buildscript {
7-
if (project == rootProject) {
8-
repositories {
9-
google()
10-
mavenCentral()
11-
}
7+
ext {
8+
buildToolsVersion = "34.0.0"
9+
minSdkVersion = 21
10+
compileSdkVersion = 34
11+
targetSdkVersion = 34
12+
ndkVersion = "25.1.8937393"
13+
kotlinVersion = "1.8.0"
14+
}
15+
if (project == rootProject) {
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
1220

13-
dependencies {
14-
classpath 'com.android.tools.build:gradle:3.5.3'
15-
}
21+
dependencies {
22+
classpath("com.android.tools.build:gradle")
23+
classpath("com.facebook.react:react-native-gradle-plugin")
24+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
1625
}
26+
}
1727
}
1828

1929
apply plugin: 'com.android.library'
2030

2131
def safeExtGet(prop, fallback) {
22-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
32+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2333
}
2434

2535
android {
26-
// Compatibility for AGP v. <4.2/Gradle 8
27-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
28-
if (agpVersion >= 7) {
29-
namespace 'com.intercom.reactnative'
30-
}
36+
namespace 'com.intercom.reactnative'
37+
compileSdk rootProject.ext.compileSdkVersion
38+
buildToolsVersion rootProject.ext.buildToolsVersion
3139

32-
compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 34)
33-
defaultConfig {
34-
minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21)
35-
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 34)
36-
versionCode 1
37-
versionName "1.0"
38-
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
39-
}
40+
defaultConfig {
41+
minSdkVersion rootProject.ext.minSdkVersion
42+
targetSdkVersion rootProject.ext.targetSdkVersion
43+
versionCode 1
44+
versionName "1.0"
45+
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
46+
}
4047

41-
buildTypes {
42-
release {
43-
minifyEnabled false
44-
}
45-
}
46-
lintOptions {
47-
disable 'GradleCompatible'
48-
}
49-
50-
if (agpVersion < 8) {
51-
compileOptions {
52-
sourceCompatibility JavaVersion.VERSION_1_8
53-
targetCompatibility JavaVersion.VERSION_1_8
54-
}
48+
buildTypes {
49+
release {
50+
minifyEnabled false
5551
}
52+
}
53+
lintOptions {
54+
disable 'GradleCompatible'
55+
}
5656
}
5757

5858
repositories {
59-
mavenCentral()
60-
mavenLocal()
61-
maven {
62-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63-
url("$rootDir/../node_modules/react-native/android")
64-
}
65-
google()
59+
mavenCentral()
60+
mavenLocal()
61+
maven {
62+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63+
url("$rootDir/../node_modules/react-native/android")
64+
}
65+
google()
6666
}
6767

6868
dependencies {
69-
//noinspection GradleDynamicVersion
70-
implementation "com.facebook.react:react-native:+" // From node_modules
71-
implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}"
72-
implementation 'io.intercom.android:intercom-sdk:15.9.+'
69+
//noinspection GradleDynamicVersion
70+
implementation "com.facebook.react:react-native:+" // From node_modules
71+
implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}"
72+
implementation 'io.intercom.android:intercom-sdk:15.9.+'
7373
}

0 commit comments

Comments
 (0)