reteno-com / reteno-react-native-sdk

MIT License
3 stars 1 forks source link

error: Command PhaseScriptExecution failed with a nonzero exit code (ios) #1

Closed abz-denys-z closed 1 year ago

abz-denys-z commented 1 year ago

Description During integration an error occurred with Sentry(https://scr.abz.agency/6quNZwqp) because two libraries were installed after the pod install command After that we downgraded Sentry (React Native) and the conflicts disappeared

At the moment there is an error with launching the script Tried to get rid of it this way:

  1. We got rid of *"EXCLUDED_ARCHS[sdk=]" = arm64;** in the main target and Reteno SDK
  2. Executed pod deintegrate && pod cache clean --all && pod install (also considering M1 architecture arch -x86_64 ...)
  3. Сhange values in the Architecture block (https://scr.abz.agency/6quNz4wz)
  4. change values in Upload Debug Symbols to Sentry block (main target) and delete it (https://scr.abz.agency/v1uEOe8g)
  5. Changed values in node_modules/react-native/scripts/find-node-for-xcode.sh on line 7 to set +e
  6. In ios/.xcode.env for NODE_BINARY set path to Node.js (which node)

Version: 1.0.0 Output of npx react-native info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 455.86 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
    Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9014738
    Xcode: 14.0/14A309 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.6 => 0.70.6 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Сode example, Screenshot

  1. Screenshot of the current error https://scr.abz.agency/d5uyOWkR
  2. Screenshot of the main targeting https://scr.abz.agency/rRu5OxdW
  3. Example package.json
    "dependencies": {
    "@codler/react-native-keyboard-aware-scroll-view": "^2.0.0",
    "@eabdullazyanov/react-native-sms-user-consent": "^1.0.10",
    "@invertase/react-native-apple-authentication": "^2.2.2",
    "@miblanchard/react-native-slider": "^2.1.0",
    "@react-native-async-storage/async-storage": "^1.15.3",
    "@react-native-community/checkbox": "^0.5.13",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^6.3.1",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-firebase/app": "^16.4.6",
    "@react-native-firebase/dynamic-links": "^16.4.6",
    "@react-native-firebase/messaging": "^16.4.6",
    "@react-native-google-signin/google-signin": "^7.2.2",
    "@react-native-seoul/masonry-list": "^1.3.2",
    "@react-navigation/bottom-tabs": "^6.4.0",
    "@react-navigation/core": "^6.4.0",
    "@react-navigation/drawer": "^6.5.0",
    "@react-navigation/native": "^6.0.13",
    "@react-navigation/stack": "^6.3.4",
    "@sentry/react-native": "^4.7.1",
    "abortcontroller-polyfill": "^1.7.3",
    "babel-plugin-module-resolver": "^4.1.0",
    "formik": "^2.2.6",
    "jwt-decode": "^3.1.2",
    "lottie-react-native": "^5.1.4",
    "mixpanel-react-native": "^2.1.0",
    "moment": "^2.29.3",
    "parse-domain": "^3.0.3",
    "prop-types": "^15.7.2",
    "react": "18.1.0",
    "react-native": "0.70.6",
    "react-native-android-open-settings": "^1.3.0",
    "react-native-appsflyer": "^6.3.20",
    "react-native-circular-progress": "^1.3.7",
    "react-native-device-info": "^8.1.3",
    "react-native-dotenv": "^3.3.1",
    "react-native-element-dropdown": "^1.8.10",
    "react-native-fast-image": "^8.6.3",
    "react-native-fbsdk-next": "^11.1.0",
    "react-native-gesture-handler": "^2.8.0",
    "react-native-get-random-values": "^1.8.0",
    "react-native-googleanalytics": "^1.0.0",
    "react-native-highlight-overlay": "^1.3.0",
    "react-native-iphone-x-helper": "^1.3.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-play-install-referrer": "^1.1.7",
    "react-native-progress": "^5.0.0",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^2.13.0",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.1.1",
    "react-native-scroll-into-view": "^2.0.2",
    "react-native-share-menu": "^6.0.0",
    "react-native-shared-group-preferences": "^1.1.23",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.1.1",
    "react-native-svg-transformer": "^0.14.3",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-toast-message": "^2.1.5",
    "react-native-url-polyfill": "^1.3.0",
    "react-native-uuid": "^2.0.1",
    "react-native-video": "^5.1.1",
    "react-native-webview": "^11.26.0",
    "react-translate": "^7.0.1",
    "reteno-react-native-sdk": "^1.0.0",
    "smartlook-react-native-wrapper": "^1.2.8",
    "uuid": "^9.0.0",
    "yup": "^0.32.11",
    "yup-phone": "^1.3.2"
    },
    "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "avo": "^3.2.2",
    "babel-jest": "^25.1.0",
    "deprecated-react-native-prop-types": "^2.3.0",
    "eslint": "^7.32.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-react": "^7.23.2",
    "jest": "^25.1.0",
    "jetifier": "^2.0.0",
    "metro-react-native-babel-preset": "0.72.3",
    "patch-package": "^6.5.0",
    "prettier": "2.6.2",
    "react-native-codegen": "^0.72.0",
    "react-test-renderer": "18.1.0"
    },
valentynhalkinreteno commented 1 year ago

Hello @abz-denys-z

Thank you for contacting.

I've created test project with your dependencies from package.json, and for now I can not reproduce your issue.

Could you please help me a little bit here:

  1. Can you please provide your Podfile dependencies in comments?
  2. On which phase script do you have this PhaseScriptExecution error? Is it Bundle React Native code and images or something else?
abz-denys-z commented 1 year ago

Can you please provide your Podfile dependencies in comments?

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
use_frameworks! :linkage => :static

target 'matin_target' do
  config = use_native_modules!
  # Flags change depending on the env values.
  flags = get_default_flags()
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'Reteno', '1.3.0'
  $RNFirebaseAsStaticFramework = true

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    # Upcoming versions of React Native may rely on get_default_flags(), but
    # we make it explicit here to aid in the React Native upgrade process.
    :hermes_enabled => true,
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
#     :flipper_configuration => FlipperConfiguration.enabled(["Debug"]),
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  target 'targetTests' do
    inherit! :complete
    # Pods for testing
  end

#   use_flipper!({ 'Flipper' => '0.125.0', 'Flipper-Folly' => '2.6.10', 'Flipper-RSocket' => '1.4.3' })
  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
#             config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
#             config.build_settings['SDKROOT'] = 'iphoneos'
#             config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
          end
        end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

target 'share' do
  use_react_native!(:hermes_enabled => true)

  pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'
  # Manually link packages here to keep your extension bundle size minimal
end

target 'notificationsReteno' do
  pod 'Reteno', '1.3.0'
end

On which phase script do you have this PhaseScriptExecution error? Is it Bundle React Native code and images or something else?

If I understand correctly, I can check here (https://scr.abz.agency/8Lug0Lnk) If so, the same state for the Run command

@valentynhalkinreteno I hope this helps you to reproduce my mistake too

abz-denys-z commented 1 year ago

@valentynhalkinreteno Also perhaps useful, I went by the documentation name AppDelegate.mm

abz-denys-z commented 1 year ago

Found the cause, the problem was in Sentry They fixed the bug in 5.0.0-alpha.10, but after conflicts we had to downgrade the version (wrote above), which caused the problem to appear again

Or update the shellScript

@valentynhalkinreteno Thank you for your time