Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 15 build fail - module 'SentryPrivate' not found #3322

Closed
5 of 11 tasks
leotm opened this issue Oct 4, 2023 · 9 comments
Closed
5 of 11 tasks

Xcode 15 build fail - module 'SentryPrivate' not found #3322

leotm opened this issue Oct 4, 2023 · 9 comments

Comments

@leotm
Copy link

leotm commented Oct 4, 2023

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.8.1

react-native version: 0.71.13

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

Configuration:

https://github.com/MetaMask/metamask-mobile/blob/main/app/util/sentryUtils.js#L143-L162


I have the following issue:

Loving Sentry ^ but run into this build error since Xcode 15 beta

Steps to reproduce:

Actual result:

Build error

Expected result:

No error

@krystofwoldrich
Copy link
Member

Hi,
thank you for the message,
I read thru the mentioned issue (MetaMask/metamask-mobile#6158) is the error happening with Xcode 15 both on the main metamask-mobile branch and in your PR?

Recently we solved a very similar issue caused by extra c compiler flags. I check your Podfile and I don't see any, but maybe some library changes them?

I'll try to clone the project to reproduce the error.

@leotm
Copy link
Author

leotm commented Oct 4, 2023

appreciate the speedy reply ^ i looked too thru

Screenshot 2023-10-02 at 8 32 24 pm

the default minimised view isn't too helpful, but expanded below

Screenshot 2023-10-02 at 8 32 42 pm

couldn't spot -Wno-documentation to remove (noting couple initial Sentry flags there), tried adding it too

then also tried messing around with some of these flags but to no avail

@leotm
Copy link
Author

leotm commented Oct 4, 2023

node node_modules/react-native/scripts/generate-codegen-artifacts.js
metamask-mobile git:(react-native-0.71.13-xcode-15-beta-8) ✗ node node_modules/react-native/scripts/generate-codegen-artifacts.js \
                --path . \
                --outputPath codegen
[Codegen] Processing react-native core libraries
[Codegen] Found react-native


[Codegen] >>>>> Searching for codegen-enabled libraries in /Users/leo/Documents/GitHub/metamask-mobile/node_modules
[Codegen] Found @react-native-community/blur
[Codegen] Found @sentry/react-native
[Codegen] Found react-native-screens
[Codegen] Found @react-native-community/datetimepicker
[Codegen] CodegenConfig Deprecated Setup for @react-native-community/slider.
    The configuration file still contains the codegen in the libraries array.
    If possible, replace it with a single object.

BEFORE:
    {
      // ...
      "codegenConfig": {
        "libraries": [
          {
            "name": "libName1",
            "type": "all|components|modules",
            "jsSrcsRoot": "libName1/js"
          },
          {
            "name": "libName2",
            "type": "all|components|modules",
            "jsSrcsRoot": "libName2/src"
          }
        ]
      }
    }

    AFTER:
    {
      "codegenConfig": {
        "name": "libraries",
        "type": "all",
        "jsSrcsRoot": "."
      }
    }

[Codegen] Found @react-native-community/slider


[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.js
  

[Codegen] >>>>> Searching for codegen-enabled libraries in the app


[Codegen] >>>>> Processing FBReactNativeSpec
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/FBReactNativeSpecMbZ9YU/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


[Codegen] >>>>> Processing rncore
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/rncorec1EIBX/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


[Codegen] >>>>> Processing rnblurview
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/rnblurviewL14bJt/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


[Codegen] >>>>> Processing RNSentrySpec
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/RNSentrySpeciNnD6p/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


[Codegen] >>>>> Processing rnscreens
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/rnscreensuxljGH/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


[Codegen] >>>>> Processing RNDateTimePickerCGen
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/RNDateTimePickerCGenjb88u8/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


[Codegen] >>>>> Processing RNCSlider
[Codegen] Generated schema: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/RNCSliderBGs0zf/schema.json
[Codegen] Generated artifacts: codegen/build/generated/ios


>>>>> Creating component provider
Generated schema list: /var/folders/6f/45z345qn1nx4l85rv0kx8y0m0000gn/T/rn-tmp-schema-list.json
Generated provider in: codegen/build/generated/ios


[Codegen] Done.

@leotm
Copy link
Author

leotm commented Oct 4, 2023

yes should be happening on main too ^ working fine on Xcode 14.2

but my PR fixes Xcode 15 issues i've encountered so far

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Oct 4, 2023

@leotm The compiler flags look good at first glance. We will have to investigate. I'll use your branch to avoid any other Xcode 15 issues.

@krystofwoldrich
Copy link
Member

I'm getting the same SentryPrivate error now.

Just to keep track.

  1. I cloned MetaMask/metamask-mobile@8daa624
  2. Applied arc fix First time build issue MetaMask/metamask-mobile#6158 (comment)
  3. Applied boost fix https://stackoverflow.com/a/77136535/8378456
  post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
        end
      end
  end

Since the last one adjusts the compiler flags it might be the similar issue as #3186

@krystofwoldrich
Copy link
Member

@leotm

I'm not getting the module 'SentryPrivate' not found error. Here is what I did:

  1. I cloned MetaMask/metamask-mobile@8daa624
  2. Applied arc fix First time build issue MetaMask/metamask-mobile#6158 (comment) (I assume you have that fixed on your machine)
  3. Have not applied boost fix stackoverflow.com/a/77136535/8378456
  4. Removed the custom react_native_post_install function https://github.com/MetaMask/metamask-mobile/blob/8daa624dd3c6a719f801d92b81407c316f372ebf/ios/Podfile#L23C1-L51C6
  5. Called the react_native_post_install from the react native package.
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
  installer,
  config[:reactNativePath],
  :mac_catalyst_enabled => false
)

Let me know if this works for you.

@leotm
Copy link
Author

leotm commented Oct 6, 2023

cheers @krystofwoldrich! got it working, noting below what i did too

reverted branch/mixpanel git submodule changes again for successful yarn setup in CI and locally
re-applied the IPHONEOS_DEPLOYMENT_TARGET bumps from 8.0 to 12.0 locally for now
TODO: @jpcloureiro's suggestion MetaMask/metamask-mobile#7114 (comment)

removed our custom react_native_post_install (the culprit)
TODO: check if we still need our custom changes and test OK on both M1/M2 and Intel Macs
referring to RN #L249-L253 right? i reckon lines #L197-L202 was right earlier, but main's prob changed already
which makes permalinks handy (;

Screenshot 2023-10-06 at 3 05 44 pm

no Sentry error 🎉 locally ran cp node_modules/@metamask/mobile-provider/dist/index.js app/core/InpageBridgeWeb3.js
TODO: so we need to tidy this our side, most likely within scripts/build.sh
edit: this is only an issue building from Xcode directly, otherwise yarn start:ios is fine

Screenshot 2023-10-06 at 3 32 38 pm Screenshot 2023-10-06 at 3 06 17 pm

Flipper strikes again, solved locally for now

Screenshot 2023-10-06 at 3 24 31 pm

TODO: need to investigate exactly how this is happening
since FB_SONARKIT_ENABLED should be disabled via MetaMask/metamask-mobile@1e432e0 and MetaMask/metamask-mobile@14d18a6 (discovered from prev seperate investigation MetaMask/metamask-mobile#6955)

then similar again

Screenshot 2023-10-06 at 3 33 25 pm Screenshot 2023-10-06 at 3 34 15 pm Screenshot 2023-10-06 at 3 35 32 pm

success 🎉

Screenshot 2023-10-06 at 3 36 40 pm Screenshot 2023-10-06 at 3 45 09 pm

appreciate your help once again

@krystofwoldrich
Copy link
Member

@leotm Awesome to hear. Thanks for the message.

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

No branches or pull requests

2 participants