singular-labs / react-native-sdk

MIT License
5 stars 6 forks source link

No known class method for selector 'createReferrerShortLink:referrerName:referrerId:passthroughParams:completionHandler' #50

Closed matthiasthomas closed 1 year ago

matthiasthomas commented 1 year ago

Hi Singular team, I'm having an issue with the latest version of the package.

Description

iOS build fails with /Users/distiller/project/apps/mind-mobile/node_modules/singular-react-native/ios/SingularBridge.m:116:15: no known class method for selector 'createReferrerShortLink:referrerName:referrerId:passthroughParams:completionHandler:'

Repro Steps

Start a build with a fresh RN 0.67.8 project

Details

package.json

...
  "dependencies": {
    "@datadog/mobile-react-native": "1.0.0-rc5",
    "@datadog/mobile-react-navigation": "1.0.0-rc5",
    "@gorhom/bottom-sheet": "4.1.5",
    "@intercom/intercom-react-native": "1.1.1",
    "@plussub/srt-vtt-parser": "1.1.0",
    "@react-native-async-storage/async-storage": "1.17.3",
    "@react-native-clipboard/clipboard": "1.8.5",
    "@react-native-community/art": "1.2.0",
    "@react-native-community/blur": "3.6.0",
    "@react-native-community/datetimepicker": "6.1.2",
    "@react-native-community/hooks": "2.8.1",
    "@react-native-community/netinfo": "8.3.0",
    "@react-native-community/push-notification-ios": "1.10.1",
    "@react-native-community/slider": "4.2.0",
    "@react-native-masked-view/masked-view": "0.2.6",
    "@react-native-picker/picker": "1.16.8",
    "@react-native-voice/voice": "3.2.3",
    "@react-navigation/bottom-tabs": "6.2.0",
    "@react-navigation/native": "6.0.8",
    "@react-navigation/native-stack": "6.5.0",
    "@react-navigation/stack": "6.1.1",
    "@reduxjs/toolkit": "1.8.0",
    "@segment/analytics-react-native": "2.2.2",
    "@segment/analytics-react-native-plugin-amplitude-session": "0.2.1",
    "@segment/sovran-react-native": "0.2.8",
    "@sentry/react-native": "3.4.1",
    "@stripe/stripe-react-native": "0.12.0",
    "@videosdk.live/react-native-incallmanager": "0.0.6",
    "@videosdk.live/react-native-sdk": "0.0.33",
    "base-64": "1.0.0",
    "chance": "1.1.8",
    "crypto-js": "3.3.0",
    "date-fns": "2.28.0",
    "datocms-structured-text-utils": "2.0.1",
    "email-validator": "2.0.4",
    "expo": "44.0.6",
    "expo-calendar": "10.1.1",
    "expo-keep-awake": "10.1.1",
    "expo-local-authentication": "12.1.1",
    "expo-media-library": "14.0.1",
    "expo-secure-store": "11.1.1",
    "fuse.js": "6.6.2",
    "graphql-request": "4.0.0",
    "graphql-tag": "2.12.6",
    "i18next": "21.6.12",
    "immer": "9.0.12",
    "immutable": "3.8.2",
    "lodash": "4.17.21",
    "lottie-ios": "3.2.3",
    "lottie-react-native": "5.0.1",
    "mailcheck": "1.1.1",
    "moment": "2.29.1",
    "nanoevents": "6.0.2",
    "query-string": "7.1.1",
    "react": "17.0.2",
    "react-datocms": "3.0.11",
    "react-i18next": "11.15.6",
    "react-native": "0.67.4",
    "react-native-androw": "0.0.34",
    "react-native-base64": "0.2.1",
    "react-native-blurhash": "1.1.9",
    "react-native-bootsplash": "3.2.7",
    "react-native-bouncy-checkbox": "2.1.10",
    "react-native-color-matrix-image-filters": "5.2.10",
    "react-native-crypto": "workspace:*",
    "react-native-device-info": "8.7.0",
    "react-native-email-link": "1.13.1",
    "react-native-fast-image": "8.5.11",
    "react-native-fs": "2.19.0",
    "react-native-gesture-handler": "2.4.2",
    "react-native-get-random-values": "1.7.2",
    "react-native-haptic-feedback": "1.13.1",
    "react-native-image-zoom-viewer": "3.0.1",
    "react-native-inappbrowser-reborn": "3.7.0",
    "react-native-keyboard-aware-scroll-view": "0.9.5",
    "react-native-linear-gradient": "2.6.2",
    "react-native-localize": "2.2.0",
    "react-native-mmkv-storage": "0.7.6",
    "react-native-modal": "13.0.0",
    "react-native-modal-datetime-picker": "13.0.1",
    "react-native-offline": "6.0.0",
    "react-native-permissions": "3.3.1",
    "react-native-purchases": "4.5.2",
    "react-native-push-notification": "8.1.1",
    "react-native-quick-actions": "0.3.13",
    "react-native-reanimated": "2.9.1",
    "react-native-redash": "16.2.3",
    "react-native-restart": "0.0.24",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "3.15.0",
    "react-native-share": "7.6.1",
    "react-native-sms": "1.11.0",
    "react-native-snap-carousel": "3.9.1",
    "react-native-status-bar-height": "2.6.0",
    "react-native-store-review": "0.2.0",
    "react-native-svg": "12.3.0",
    "react-native-svg-charts": "5.4.0",
    "react-native-swift": "1.2.3",
    "react-native-track-player": "2.1.2",
    "react-native-video": "5.2.0",
    "react-query": "3.34.16",
    "react-redux": "7.2.3",
    "redux": "4.1.2",
    "redux-devtools-extension": "2.13.9",
    "redux-persist": "6.0.0",
    "redux-persist-transform-immutable": "5.0.0",
    "redux-saga": "1.1.3",
    "regenerator-runtime": "0.13.9",
    "reselect": "4",
    "rn-apple-healthkit": "0.8.0",
    "rn-fetch-blob": "0.12.0",
    "semver": "7.3.7",
    "singular-react-native": "3.1.0",
    "styled-components": "5.3.3",
    "ts-node": "10.5.0",
    "use-memo-one": "1.1.2",
    "uuid": "8.3.2",
    "yarn": "1.22.17",
    "zod": "3.13.4",
    "zxcvbn": "4.4.2"
  },
  "devDependencies": {
    "@babel/core": "7.17.9",
    "@babel/eslint-parser": "7.17.0",
    "@babel/preset-typescript": "7.16.7",
    "@babel/runtime": "7.17.9",
    "@graphql-codegen/add": "3.1.1",
    "@graphql-codegen/cli": "2.6.2",
    "@graphql-codegen/typescript": "2.4.5",
    "@graphql-codegen/typescript-graphql-request": "4.3.7",
    "@graphql-codegen/typescript-operations": "2.3.2",
    "@graphql-codegen/typescript-react-query": "3.5.5",
    "@types/base-64": "1.0.0",
    "@types/chance": "1.1.3",
    "@types/crypto-js": "4.1.1",
    "@types/flat": "5.0.2",
    "@types/jest": "27.4.1",
    "@types/json-diff": "0.7.0",
    "@types/lodash": "4.14.180",
    "@types/node": "14.18.12",
    "@types/prompts": "2.0.14",
    "@types/react": "17.0.48",
    "@types/react-native": "0.67.8",
    "@types/react-native-base64": "0.2.0",
    "@types/react-native-push-notification": "7.3.3",
    "@types/react-native-video": "5.0.12",
    "@types/react-redux": "7.1.16",
    "@types/semver": "7.3.9",
    "@types/styled-components": "5.1.24",
    "@types/styled-components-react-native": "5.1.3",
    "@types/uuid": "8.3.4",
    "@typescript-eslint/eslint-plugin": "5.13.0",
    "@typescript-eslint/parser": "5.17.0",
    "axios": "0.26.0",
    "babel-jest": "27.5.1",
    "babel-plugin-module-resolver": "4.1.0",
    "babel-plugin-require-context-hook": "1.0.0",
    "babel-plugin-transform-inline-environment-variables": "0.4.3",
    "babel-plugin-transform-remove-console": "6.9.4",
    "chalk": "4.1.2",
    "chokidar": "3.5.3",
    "danger": "11.0.2",
    "datocms-client": "3.5.14",
    "deepmerge": "4.2.2",
    "eslint": "8.1.0",
    "eslint-config-airbnb": "18.2.1",
    "eslint-config-airbnb-base": "15.0.0",
    "eslint-config-prettier": "8.4.0",
    "eslint-config-standard": "16.0.3",
    "eslint-import-resolver-babel-module": "5.3.1",
    "eslint-import-resolver-typescript": "2.7.1",
    "eslint-plugin-import": "2.25.4",
    "eslint-plugin-jest": "26.1.1",
    "eslint-plugin-jsx-a11y": "6.5.1",
    "eslint-plugin-prettier": "4.0.0",
    "eslint-plugin-react": "7.29.2",
    "eslint-plugin-react-hooks": "4.3.0",
    "eslint-plugin-react-native": "4.0.0",
    "eslint-plugin-standard": "5.0.0",
    "fbjs-scripts": "3.0.1",
    "flat": "5.0.2",
    "flipper-plugin-rn-performance-android": "0.1.0",
    "graphql": "16.3.0",
    "jest": "27.5.1",
    "jest-expo": "45.0.1",
    "json-diff": "0.7.1",
    "metro-config": "0.70.1",
    "metro-react-native-babel-transformer": "0.69.0",
    "ora": "5.4.1",
    "pascal-case": "3.1.2",
    "prettier": "2.5.1",
    "prompts": "2.4.2",
    "react-native-svg-transformer": "1.0.0",
    "stylelint": "13.13.1",
    "stylelint-config-recommended": "5.0.0",
    "stylelint-config-styled-components": "0.1.1",
    "stylelint-processor-styled-components": "1.10.0",
    "traverse": "0.6.6",
    "ts-morph": "13.0.3",
    "typescript": "4.6.4",
    "walkdir": "0.4.1"
  },
  "packageManager": "yarn@3.2.0",
}

Podfile

# frozen_string_literal: true

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '12.0'

# hide warning from pods to be able to focus on own warnings
inhibit_all_warnings!

target 'app' do
  project 'app',
          'Staging Debug' => :debug,
          'Staging Release' => :release

  use_expo_modules!

  pod 'react-native-svg-image', :path => '../node_modules/react-native-svg-image'

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
  config = use_native_modules!
  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  pod 'RNCPushNotificationIOS', path: '../node_modules/@react-native-community/push-notification-ios'

  pod 'react-native-restart', path: '../node_modules/react-native-restart'

  pod 'react-native-webrtc', :path => '../node_modules/@videosdk.live/react-native-webrtc'

  # Permissions for camera/library access
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', path: "#{permissions_path}/Camera"
  pod 'Permission-PhotoLibrary', path: "#{permissions_path}/PhotoLibrary"
  pod 'Permission-Microphone', path: "#{permissions_path}/Microphone"
  pod 'Permission-SpeechRecognition', path: "#{permissions_path}/SpeechRecognition"
  pod 'react-native-webrtc', :path => '../node_modules/@videosdk.live/react-native-webrtc'

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

react-native info output

System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 130.63 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 3.2.0 - ~/app/node_modules/.bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
    Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/opt/cocoapods/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8512546
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.67.4 => 0.67.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

pod --version output

1.11.3

Steps I took to resolve the issue which were unsuccessful

rm -rf $TMPDIR/react-*
rm -rf $TMPDIR/npm-*
rm -rf $TMPDIR/haste-*
rm -rf $TMPDIR/metro-*
rm -rf $TMPDIR/haste-map-react-native-packager-*

rm -rf node_modules
yarn cache clean
yarn
rm -rf ios/Pods
cd ios
pod cache clean --all
pod repo update
pod install
cd ..

rm -rf ios/build
rm -rf ~/Library/Developer/Xcode/DerivedData/

watchman watch-del-all
yarn start --reset-cache
jayfunk commented 1 year ago

Same here. I updated to version 3.1.9 from 3.1.4 and now I am unable to build the iOS version of the app.

jayfunk commented 1 year ago

@matthiasthomas So I think I found a workaround. Try running pod update Singular-SDK in your ios folder. Since 3.1.7 it appears the library is depending on new APIs that are in later versions of the Singular-SDK but the react-native package is not specifying which version of the SDK is required for proper support.

matthiasthomas commented 1 year ago

It worked @jayfunk! Thank you so much 🙏

@eyalsingular - Would be nice to add a dependency to the right Singular-SDK version to fix this permanently 🙂

shefdanny commented 1 year ago

Thanks @matthiasthomas for bringing this is up to our attention. Changed in latest version.