smartlook / smartlook-mobile-issue-tracker

Official Smartlook issue tracker for mobile SDKs
4 stars 0 forks source link

Unable to build Smartlook with React Native #63

Closed zhahaoyu closed 3 years ago

zhahaoyu commented 3 years ago

Platform

iOS

Technology

React Native

Build instructions [optional]

React Native version - 0.63.2

"dependencies": {
    "@ant-design/icons-react-native": "^2.2.1",
    "@quick/client": "../quick-client-ts",
    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/cookies": "^5.0.1",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/drawer": "^5.10.6",
    "@react-navigation/native": "^5.7.5",
    "@react-navigation/stack": "^5.9.2",
    "@types/lodash.debounce": "^4.0.6",
    "@welldone-software/why-did-you-render": "^5.0.0",
    "dayjs": "^1.9.6",
    "fetch-intercept": "^2.3.1",
    "lodash.debounce": "^4.0.8",
    "react": "16.13.1",
    "react-async-hook": "^3.6.2",
    "react-native": "0.63.2",
    "react-native-camera": "^3.40.0",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-credit-card-input": "^0.4.1",
    "react-native-dotenv": "^2.5.3",
    "react-native-elements": "^3.0.0-alpha.1",
    "react-native-floating-action": "^1.21.0",
    "react-native-gesture-handler": "^1.8.0",
    "react-native-intercom": "^18.0.0",
    "react-native-maps": "0.27.1",
    "react-native-reanimated": "^1.13.1",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-screens": "^2.11.0",
    "react-native-svg": "^12.1.0",
    "react-native-vector-icons": "^7.1.0",
    "smartlook-react-native-wrapper": "^0.39.0",
    "tipsi-stripe": "8.0.0-beta.11"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "@types/jest": "^25.2.3",
    "@types/react-native": "^0.63.2",
    "@types/react-test-renderer": "^16.9.2",
    "@typescript-eslint/eslint-plugin": "^2.27.0",
    "@typescript-eslint/parser": "^2.27.0",
    "babel-jest": "^25.1.0",
    "eslint": "^6.5.1",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "prettier": "^2.1.2",
    "react-native-bundle-visualizer": "^2.2.1",
    "react-native-svg-transformer": "^0.14.3",
    "react-test-renderer": "16.13.1",
    "typescript": "^3.8.3"
  },

Rendering [optional]

default rendering

Affected devices [optional]

Smartlook SDK version

Smartlook (1.7.1)

Summary

Trying to build the release version of the app based on steps here https://reactnative.dev/docs/publishing-to-app-store. The build script complained the following errors:

Undefined symbols for architecture i386:
  "_SLSetupOptionStartNewSessionKey", referenced from:
      -[RNSmartlook setupSmartlook:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLSetupOptionFramerateKey", referenced from:
      -[RNSmartlook setupSmartlook:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeWireframe", referenced from:
      ___32-[RNSmartlook setRenderingMode:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook currentRenderingMode:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionNone", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLSetupOptionStartNewSessionAndResetUserKey", referenced from:
      -[RNSmartlook setupSmartlook:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionColorWireframe", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionBlueprintWireframe", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_OBJC_CLASS_$_Smartlook", referenced from:
      objc-class-ref in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeNative", referenced from:
      ___32-[RNSmartlook setRenderingMode:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLEventTrackingModeNoTracking", referenced from:
      -[RNSmartlook initializeEnumTranslators] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLNavigationTypeExit", referenced from:
      ___46-[RNSmartlook trackNavigationEvent:direction:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)

and

Undefined symbols for architecture x86_64:
  "_SLDashboardSessionURLChangedNotification", referenced from:
      -[RNSmartlook integrationURLDidChange:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook registerIntegrationListener] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook unregisterIntegrationListener] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLDashboardVisitorURLChangedNotification", referenced from:
      -[RNSmartlook integrationURLDidChange:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook registerIntegrationListener] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook unregisterIntegrationListener] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionNone", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeWireframe", referenced from:
      ___32-[RNSmartlook setRenderingMode:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook currentRenderingMode:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLNavigationTypeEnter", referenced from:
      ___46-[RNSmartlook trackNavigationEvent:direction:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionIconBlueprintWireframe", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeNoRendering", referenced from:
      ___32-[RNSmartlook setRenderingMode:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
      -[RNSmartlook currentRenderingMode:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLSetupOptionStartNewSessionKey", referenced from:
      -[RNSmartlook setupSmartlook:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionColorWireframe", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeOptionBlueprintWireframe", referenced from:
      -[RNSmartlook currentRenderingModeOption:rejecter:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLSetupOptionStartNewSessionAndResetUserKey", referenced from:
      -[RNSmartlook setupSmartlook:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLSetupOptionFramerateKey", referenced from:
      -[RNSmartlook setupSmartlook:] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLEventTrackingModeIgnoreUserInteractionEvents", referenced from:
      -[RNSmartlook initializeEnumTranslators] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLEventTrackingModeFullTracking", referenced from:
      -[RNSmartlook initializeEnumTranslators] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLEventTrackingModeIgnoreRageClickEvents", referenced from:
      -[RNSmartlook initializeEnumTranslators] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLEventTrackingModeIgnoreNavigationInteractionEvents", referenced from:
      -[RNSmartlook initializeEnumTranslators] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_OBJC_CLASS_$_Smartlook", referenced from:
      objc-class-ref in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLRenderingModeNative", referenced from:
      ___32-[RNSmartlook setRenderingMode:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLNavigationTypeExit", referenced from:
      ___46-[RNSmartlook trackNavigationEvent:direction:]_block_invoke in libsmartlook-react-native-bridge.a(RNSmartlook.o)
  "_SLEventTrackingModeNoTracking", referenced from:
      -[RNSmartlook initializeEnumTranslators] in libsmartlook-react-native-bridge.a(RNSmartlook.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce [optional]

  1. Make changes according to this - https://reactnative.dev/docs/publishing-to-app-store
  2. npx react-native run-ios --configuration Release

Example Project [optional]

Relevant logs and/or screenshots

Pod file

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'QuickApp' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'QuickAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # 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|
    flipper_post_install(installer)
  end
end

target 'QuickApp-tvOS' do
  # Pods for QuickApp-tvOS

  target 'QuickApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end
pavel-kroh-smartlook commented 3 years ago

Hi, this error means that Smartlook is not properly installed. Could you try running pod install in the ios folder of your app manually?

zhahaoyu commented 3 years ago

I have done it multiple times, but it is not solving the problem. It is still complaining. When I ran the debug build command npx react-native run-ios, it worked perfectly fine and I was able to see the smartlook screen recording. But when I tried the release build command npx react-native run-ios --configuration Release, I keep getting the above error.

zhahaoyu commented 3 years ago

Btw I have dead code stripping enabled. Could this be related? I have seen some posts suggest that this option should be turned off, but the build fails completely once I turn it off. Even core react libraries would complain.

pavel-kroh-smartlook commented 3 years ago

Hi @zhahaoyu ,

after the second look on the error logs, there is something seriously wrong with the release script or the Xcode project.

The platforms i386 and x86_64, where the Smartlook is missing according to the logs you shared, are simulator-only platforms, and cannot be part of the released app. Thus it is all right they are not there. Why the npx react-native run-ios --configuration Release requires them is not clear.

The standard way to release an iOS app is to archive it first using Xcode Product → Archive menu and then sending it to the App Store using the Windows → Organiser (should opens automatically after the archiving is done).

pavel-kroh-smartlook commented 3 years ago

Closing abandoned issue.