Skip to content

Commit

Permalink
fix(react-native): upgrade to react-native 0.76.2 (#81)
Browse files Browse the repository at this point in the history
* fix(react-native): upgrade to react-native to 0.76.2

* fix(eslint): add missing dependency
  • Loading branch information
mateogianolio authored Nov 20, 2024
1 parent 84880b4 commit 1145475
Show file tree
Hide file tree
Showing 20 changed files with 4,603 additions and 1,648 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
}

override fun onFailure(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}
})
} else {
Expand Down Expand Up @@ -186,7 +188,9 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
}

override fun onWiFiScanFailed(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}
})
}
Expand Down Expand Up @@ -317,45 +321,44 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
promise?.resolve(result)
}

override fun reject(p0: String?, p1: String?) {
promise?.reject(p0, p1)
override fun reject(message: String) {
promise?.reject(message)
}

override fun reject(p0: String?, p1: Throwable?) {
promise?.reject(p0, p1)
override fun reject(code: String, userInfo: WritableMap) {
promise?.reject(code, userInfo)
}

override fun reject(p0: String?, p1: String?, p2: Throwable?) {
promise?.reject(p0, p1, p2)
override fun reject(code: String, message: String?) {
promise?.reject(code, message)
}

override fun reject(p0: Throwable?) {
promise?.reject(p0)
override fun reject(code: String, message: String?, userInfo: WritableMap) {
promise?.reject(code, message, userInfo)
}

override fun reject(p0: Throwable?, p1: WritableMap?) {
promise?.reject(p0, p1)
override fun reject(code: String, message: String?, throwable: Throwable?) {
promise?.reject(code, message, throwable)
}

override fun reject(p0: String?, p1: WritableMap) {
promise?.reject(p0, p1)
override fun reject(code: String, throwable: Throwable?) {
promise?.reject(code, throwable)
}

override fun reject(p0: String?, p1: Throwable?, p2: WritableMap?) {
promise?.reject(p0, p1, p2)
override fun reject(code: String, throwable: Throwable?, userInfo: WritableMap) {
promise?.reject(code, throwable, userInfo)
}

override fun reject(p0: String?, p1: String?, p2: WritableMap) {
promise?.reject(p0, p1, p2)
override fun reject(code: String?, message: String?, throwable: Throwable?, userInfo: WritableMap?) {
promise?.reject(code, message, throwable, userInfo)
}

override fun reject(p0: String?, p1: String?, p2: Throwable?, p3: WritableMap?) {
promise?.reject(p0, p1, p2, p3)
override fun reject(throwable: Throwable) {
promise?.reject(throwable)
}

@Deprecated("Deprecated in Java", ReplaceWith("promise?.reject(p0)"))
override fun reject(p0: String?) {
promise?.reject(p0)
override fun reject(throwable: Throwable, userInfo: WritableMap) {
promise?.reject(throwable, userInfo)
}
})
}
Expand Down Expand Up @@ -425,7 +428,9 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
}

override fun onFailure(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}
})
}
Expand Down Expand Up @@ -453,7 +458,9 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
}

override fun onWiFiScanFailed(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}
})
}
Expand All @@ -472,23 +479,29 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon

espDevice.provision(ssid, passphrase, object : ProvisionListener {
override fun createSessionFailed(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}

override fun wifiConfigSent() {
return
}

override fun wifiConfigFailed(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}

override fun wifiConfigApplied() {
return
}

override fun wifiConfigApplyFailed(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}

override fun provisioningFailedFromDevice(failureReason: ESPConstants.ProvisionFailureReason?) {
Expand All @@ -502,7 +515,9 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
}

override fun onProvisioningFailed(e: Exception?) {
promise?.reject(e)
if (e != null) {
promise?.reject(e)
}
}
})
}
Expand Down
5 changes: 4 additions & 1 deletion example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.12'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
4 changes: 3 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand Down Expand Up @@ -117,5 +120,4 @@ dependencies {
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package com.espidfprovisioningexample

import android.os.Bundle;
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(null)
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {
Expand All @@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
Expand Down
8 changes: 4 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

buildscript {
ext {
buildToolsVersion = "34.0.0"
buildToolsVersion = "35.0.0"
minSdkVersion = 26
compileSdkVersion = 34
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.android.tools.build:gradle:8.7.2")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
Expand Down
2 changes: 0 additions & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions example/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions example/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
4 changes: 3 additions & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'EspIdfProvisioningExample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
USE_HERMES = true;
};
name = Debug;
Expand Down
Loading

0 comments on commit 1145475

Please sign in to comment.