镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

v1.4.7 doesn't working with react native 0.77 on Android #41

Open

Description

@jingp-ofload

I am using
v1.4.7 with
expo 0.52 and react native 0.77.

The complier throws following errors:

Image

Activity

  1. ianrumac commented on Feb 3, 2025

    @ianrumac
    Contributor

    Hey @jingp-ofload !
    This seems quite weird - could you share more details about the Android side of your setup?
    Testing our expo-example with both of these dependencies and it seems to be running smoothly - would be great if you could share your build.gradle file. Also, are you using RN with the new architecture enabled?

  2. jp928 commented on Feb 3, 2025

    @jp928

    I do enabled new architecture which is by default. I guess the thing is react native 0.77 is shipped with Kotlin 2.0.2.

  3. leomiller12 commented on Apr 3, 2025

    @leomiller12

    Someone found a solution?

  4. jp928 commented on Apr 3, 2025

    @jp928

    @leomiller12 I am using "@superwall/react-native-superwall": "^2.0.9",
    and this is my patch

    diff --git a/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/SuperwallReactNativeModule.kt b/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/SuperwallReactNativeModule.kt
    index a38b4d5..54f6e9c 100644
    --- a/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/SuperwallReactNativeModule.kt
    +++ b/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/SuperwallReactNativeModule.kt
    @@ -156,10 +156,10 @@ class SuperwallReactNativeModule(private val reactContext: ReactApplicationConte
               .emit("paywallPresentationHandler", data)
           }
         }
    -
    +    val mapParams = params?.let { convertReadableMapToMap(it).filterValues { it != null } } as Map<String, Any>
         Superwall.instance.register(
           placement = event,
    -      params = params?.toHashMap(),
    +      params = mapParams,
           handler = handler,
           feature = {
             feature?.resolve(null)
    @@ -337,8 +337,9 @@ class SuperwallReactNativeModule(private val reactContext: ReactApplicationConte
         params: ReadableMap?,
         promise: Promise
       ) {
    +    val mapParams = params?.let { convertReadableMapToMap(it).filterValues { it != null } } as Map<String, Any>
         CoroutineScope(Dispatchers.IO).launch {
    -      Superwall.instance.getPresentationResult(event, params?.toHashMap()).fold({
    +      Superwall.instance.getPresentationResult(event, mapParams).fold({
             launch(Dispatchers.Main) {
               promise.resolve(it.toJson())
             }
    diff --git a/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/models/SuperwallOptions.kt b/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/models/SuperwallOptions.kt
    index e9e97fc..8b12772 100644
    --- a/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/models/SuperwallOptions.kt
    +++ b/node_modules/@superwall/react-native-superwall/android/src/main/java/com/superwallreactnative/models/SuperwallOptions.kt
    @@ -33,7 +33,7 @@ class SuperwallOptions {
             for (i in 0 until scopesArray.size()) {
               val scopeStr = scopesArray.getString(i)
               try {
    -            scopes.add(enumValueOf<LogScope>(scopeStr))
    +            scopes.add(scopeStr?.let { enumValueOf<LogScope>(it) })
               } catch (e: IllegalArgumentException) {}
             }
           }
    
  5. leomiller12 commented on Apr 4, 2025

    @leomiller12

    @jp928 thanks, I appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions