adaptyteam / AdaptySDK-React-Native

React Native SDK for growing in-app subscriptions
https://docs.adapty.io/docs/quickstart
MIT License
128 stars 12 forks source link

Adapty NativeModule is not defined #132

Open yuhr opened 5 days ago

yuhr commented 5 days ago

Description

screen

I'm experiencing this while migrating our bare React Native 0.73.4 project to Expo 52 CNG setup. The installation guide doesn't help as we're not using EAS Build yet; we want to stick to expo run:* for now to avoid wasting the free quota of build count.

Could someone provide any clue about what might cause this error?

Few notes:

Version

v2.11.3

What platforms are you seeing the problem on?

Android

System info

System:
  OS: macOS 15.0
  CPU: (8) arm64 Apple M1
  Memory: 82.44 MB / 16.00 GB
  Shell:
    version: 3.7.1
    path: /opt/homebrew/bin/fish
Binaries:
  Node:
    version: 18.18.2
    path: ~/.local/share/mise/installs/node/18.18.2/bin/node
  Yarn: Not Found
  npm:
    version: 9.8.1
    path: ~/.local/share/mise/installs/node/18.18.2/bin/npm
  Watchman:
    version: 2024.08.19.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/yuhr/.local/share/mise/installs/ruby/3.2.1/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-29 | Google APIs ARM 64 v8a
      - android-32 | Google APIs ARM 64 v8a
      - android-32 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2020.3 AI-203.7717.56.2031.7935034
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Users/yuhr/.local/share/mise/installs/java/adoptopenjdk-17.0.10+7/bin/javac
  Ruby:
    version: 3.2.1
    path: /Users/yuhr/.local/share/mise/installs/ruby/3.2.1/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 12.3.4
    wanted: ^12.3.4
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.2
    wanted: 0.76.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
vladd-g commented 5 days ago

Hi @yuhr, thank you for the report!

We're working on making expo auto-linking work! Could you try disabling the expo auto-linking for now?

Bjarkinn commented 3 days ago

Having the same issue on Android

Disabling auto linking with the following did not fix the problem

react-native.config.js

module.exports = {
  dependencies: {
    'react-native-adapty': {
      platforms: {
        android: null,
      },
    },
  },
}

The app builds but the following error is thrown when the app loads Error: Adapty NativeModule is not defined, js engine: hermes [Component Stack]

Hope this gets resolved soon

vladd-g commented 2 days ago

Hi @yuhr @Bjarkinn

Could you please try 3.0.2-canary.0?

Bjarkinn commented 2 days ago

Hi @yuhr @Bjarkinn

Could you please try 3.0.2-canary.0?

Was able to run the app with 3.0.2-canary.0 and everyting seems to be working like before. GJ!

Will this be released soon?

yuhr commented 2 days ago

@vladd-g 3.0.2-canary.0 is working as expected, thanks!

MuhammedYesilyurt commented 11 hours ago

Iam using this versions but still getting same error: "@adapty/react-native-ui": "^3.0.1", "react-native-adapty": "^3.0.2-canary.0",