Skip to content

Commit 3244f0b

Browse files
authored
chore(example): rn 0.76.0 update in example app (#3660)
1 parent e28ed8f commit 3244f0b

File tree

10 files changed

+375
-346
lines changed

10 files changed

+375
-346
lines changed

android/src/main/java/com/rnmapbox/rnmbx/utils/ViewTagResolver.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typealias ViewRefTag = Double
2020
// see https://github.com/rnmapbox/maps/pull/3074
2121
open class ViewTagResolver(val context: ReactApplicationContext) {
2222
private val createdViews: HashSet<Int> = hashSetOf<Int>()
23-
private val viewWaiters: HashMap<Int, MutableList<ViewTagWaiter<View>>> = hashMapOf()
23+
private val viewWaiters: HashMap<Int, MutableList<ViewTagWaiter<View?>>> = hashMapOf()
2424

2525
// to be called from view.setId
2626
fun tagAssigned(viewTag: Int) {
@@ -68,7 +68,14 @@ open class ViewTagResolver(val context: ReactApplicationContext) {
6868
}
6969
} catch (err: IllegalViewOperationException) {
7070
if (!createdViews.contains(viewTag)) {
71-
viewWaiters.getOrPut(viewTag) { mutableListOf<ViewTagWaiter<View>>() }.add(ViewTagWaiter<View>({ view -> fn(view as V) }, reject))
71+
viewWaiters.getOrPut(viewTag) { mutableListOf<ViewTagWaiter<View?>>() }.add(ViewTagWaiter<View?>({ view ->
72+
if (view != null) {
73+
fn(view as V)
74+
} else {
75+
Logger.e(LOG_TAG, "view: $viewTag but is null")
76+
reject?.reject(Throwable("view: $viewTag but is null"))
77+
}
78+
}, reject))
7279
} else {
7380
reject?.reject(err)
7481
}

example/android/app/src/main/java/com/rnmapboxglexample/MainApplication.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.facebook.react.ReactPackage
88
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
99
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1010
import com.facebook.react.defaults.DefaultReactNativeHost
11+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1112
import com.facebook.soloader.SoLoader
1213
class MainApplication : Application(), ReactApplication {
1314
override val reactNativeHost: ReactNativeHost =
@@ -26,10 +27,10 @@ class MainApplication : Application(), ReactApplication {
2627
get() = getDefaultReactHost(applicationContext, reactNativeHost)
2728
override fun onCreate() {
2829
super.onCreate()
29-
SoLoader.init(this, false)
30+
SoLoader.init(this, OpenSourceMergedSoMapping)
3031
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
3132
// If you opted-in for the New Architecture, we load the native entry point for this app.
3233
load()
3334
}
3435
}
35-
}
36+
}

example/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ buildscript {
2828
}
2929
}
3030

31-
buildToolsVersion = "34.0.0"
32-
minSdkVersion = 23
33-
compileSdkVersion = 34
31+
buildToolsVersion = "35.0.0"
32+
minSdkVersion = 24
33+
compileSdkVersion = 35
3434
targetSdkVersion = 34
3535
ndkVersion = "26.1.10909125"
3636
kotlinVersion = "1.9.24"

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/gradlew

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum

example/android/gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%" == "" @echo off
1820
@rem ##########################################################################

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require Pod::Executable.execute_command('node', ['-p',
55
{paths: [process.argv[1]]},
66
)', __dir__]).strip
77

8-
platform :ios, '13.4'
8+
platform :ios, '15.1'
99
prepare_react_native_project!
1010

1111
$RNMapboxMapsImpl = 'mapbox'

0 commit comments

Comments
 (0)