Skip to content

Commit

Permalink
fix: Upgrading kotlin version to 1.8.0 prevents project from compiling (
Browse files Browse the repository at this point in the history
#35)

* Upgrade react native and kotlin

* Upgrade TwilioVerify SDK and bump version
  • Loading branch information
yafuquen authored Oct 9, 2023
1 parent 6f1f2bc commit 7b77544
Show file tree
Hide file tree
Showing 19 changed files with 5,274 additions and 4,360 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project provides a library to implement Verify Push for your react native a

## Dependencies

React native 0.64.1
React native 0.66.5

## Installation

Expand Down Expand Up @@ -146,6 +146,8 @@ npx pod-install
yarn example ios
```

> **_NOTE:_** There could be incompatibility issues with the react native version and your environment, so running the project from Xcode could share more details about the error and how to fix it
### Android

* Follow the steps from [Firebase configuration](https://firebase.google.com/docs/android/setup#console), follow steps 1 to 3
Expand Down
14 changes: 5 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -47,8 +47,8 @@ android {
defaultConfig {
minSdkVersion 23
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
versionCode 3
versionName "0.3.0"
versionCode 4
versionName "0.4.0"

}

Expand All @@ -60,15 +60,10 @@ android {
lintOptions {
disable 'GradleCompatible'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

repositories {
mavenCentral()
jcenter()
google()

def found = false
Expand Down Expand Up @@ -143,5 +138,6 @@ dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.twilio:twilio-verify-android:0.7.0'
implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"))
implementation 'com.twilio:twilio-verify-android:0.8.0'
}
8 changes: 4 additions & 4 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RNTwilioVerify_kotlinVersion=1.3.50
RNTwilioVerify_compileSdkVersion=29
RNTwilioVerify_buildToolsVersion=29.0.3
RNTwilioVerify_targetSdkVersion=29
RNTwilioVerify_kotlinVersion=1.8.0
RNTwilioVerify_compileSdkVersion=30
RNTwilioVerify_buildToolsVersion=30.0.2
RNTwilioVerify_targetSdkVersion=30
android.useAndroidX=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class RNTwilioVerifyModule(
updateFactorPayload.getStringValue("sid"),
updateFactorPayload.getOptStringValue("pushToken")
), { promise.resolve(toReadableMap(it)) }, { promise.reject(it) })
else -> promise.reject(IllegalArgumentException("Invalid update factor payload"))
}
}

Expand Down Expand Up @@ -146,6 +147,7 @@ class RNTwilioVerifyModule(
{ promise.resolve(null) },
{ exception -> promise.reject(exception) })
}
else -> promise.reject(IllegalArgumentException("Invalid update challenge payload"))
}
}

Expand Down
13 changes: 4 additions & 9 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,12 @@ def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.twilio.verify.reactnative.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 3
versionName "0.3.0"
versionCode 4
versionName "0.4.0"
}
splits {
abi {
Expand Down Expand Up @@ -209,7 +204,7 @@ dependencies {

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
Expand All @@ -235,7 +230,7 @@ apply plugin: 'com.google.gms.google-services'
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

Expand Down
21 changes: 15 additions & 6 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,26 @@

buildscript {
ext {
buildToolsVersion = "29.0.3"
buildToolsVersion = "30.0.2"
minSdkVersion = 23
compileSdkVersion = 29
targetSdkVersion = 29
compileSdkVersion = 30
targetSdkVersion = 30
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("com.android.tools.build:gradle:4.2.2")
classpath('com.google.gms:google-services:4.3.3')

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
repositories {
mavenLocal()
Expand All @@ -49,7 +51,14 @@ allprojects {
}

google()
jcenter()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}

configurations.all {
resolutionStrategy {
// Remove this override in 0.66, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
}
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

android.useAndroidX=true
android.enableJetifier=true
FLIPPER_VERSION=0.75.1
FLIPPER_VERSION=0.99.0
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
platform :ios, '11.0'

target 'RNTwilioVerifyExample' do
config = use_native_modules!
Expand All @@ -21,5 +21,6 @@ target 'RNTwilioVerifyExample' do
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
Loading

0 comments on commit 7b77544

Please sign in to comment.