React Native上的Sentry:为iOS构建中断,“在类型为”PrivateSentrySDKOnly“的对象上未找到属性”options“”

68de4m5k  于 2022-12-04  发布在  React
关注(0)|答案(1)|浏览(100)

我正在使用CircleCI为iOS(和Android)构建,最近,iOS构建失败,并显示以下错误消息:

Compiling RNSentry.m

❌  /Users/distiller/project/node_modules/@sentry/react-native/ios/RNSentry.m:107:79: property 'options' not found on object of type 'PrivateSentrySDKOnly'

    if (appIsActive && !sentHybridSdkDidBecomeActive && (PrivateSentrySDKOnly.options.enableAutoSessionTracking || PrivateSentrySDKOnly.options.enableOutOfMemoryTracking)) {
               ^


❌  /Users/distiller/project/node_modules/@sentry/react-native/ios/RNSentry.m:107:137: property 'options' not found on object of type 'PrivateSentrySDKOnly'

    if (appIsActive && !sentHybridSdkDidBecomeActive && (PrivateSentrySDKOnly.options.enableAutoSessionTracking || PrivateSentrySDKOnly.options.enableOutOfMemoryTracking)) {
                                                                              ^


❌  /Users/distiller/project/node_modules/@sentry/react-native/ios/RNSentry.m:155:39: property 'getSdkName' not found on object of type 'PrivateSentrySDKOnly'

        @"name": PrivateSentrySDKOnly.getSdkName,
                                                                                                                                        ^


❌  /Users/distiller/project/node_modules/@sentry/react-native/ios/RNSentry.m:195:34: property 'options' not found on object of type 'PrivateSentrySDKOnly'

        if (PrivateSentrySDKOnly.options.debug

它曾经致力于为iOS构建,我 * 认为 * 这与Sentry的版本有关;我想我试图将Sentry版本更新到4.9.0,但却发现4.9.0有一些严重的问题(我认为)。我不够聪明,无法准确地得出这里的结论,但我认为它与以下内容有关:
https://github.com/getsentry/sentry-cocoa/issues/1665https://github.com/getsentry/sentry-react-native/issues/2530(我正在寻找另一个相关的URL,但现在找不到)
Android可以用配置之类的东西来构建,但是iOS失败了。我不知道该怎么做才能解决这个问题,我想要一些输入=)
json包具有Sentry 4.8.0:

"dependencies": {
    "@react-native-async-storage/async-storage": "^1.17.4",
    "@react-native-community/cli-platform-android": "^6.3.0",
    "@sentry/react-native": "4.8.0",
    "@turf/distance": "^6.0.1",
    "axios": "^1.1.1",
    "dotenv": "^16.0.0",
    "eventing-bus": "^2.0.1",
    "jetifier": "^2.0.0",
    "lodash": "^4.17.15",
    "moment": "^2.29.3",
    "moment-timezone": "^0.5.34",
    "patch-package": "^6.4.7",
    "react": "17.0.2",
    "react-native": "0.67.4",

以下是我的配置/设置的其余部分:

PS C:\Github\alfaonlinev3> npx react-native doctor
Common
 ✓ Node.js
 ✓ yarn

Android
 ✓ JDK
 ✖ Android Studio - Required for building and installing your app on Android
 ✓ Android SDK - Required for building and installing your app on Android
 ✓ ANDROID_HOME

Errors:   1
Warnings: 0

注意:我已经安装了Android Studio,它正在为Android原生项目工作。除了下载另一个Android Studio副本外,不知道医生为什么抱怨或如何解决它?

envinfo:
  Visual Studio code: 1.73.1

  System:
    OS: Windows 10 10.0.19044
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 5.01 GB / 31.95 GB
  Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
  Managers:
    pip2: 19.2.3 - C:\Python27\Scripts\pip2.EXE
    pip3: 21.1.1 - C:\Python39\Scripts\pip3.EXE
  Utilities:
    Git: 2.34.1.
  SDKs:
    Android SDK:
      API Levels: 28, 29, 30, 31, 33
      Build Tools: 28.0.3, 29.0.0, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
  IDEs:
    VSCode: 1.73.1 - C:\Program Files\Microsoft VS Code\bin\code.CMD
    Visual Studio: 17.3.32519.111 (Visual Studio Community 2022), 16.11.32106.194 (Visual Studio Community 2019)
  Languages:
    Java: 19.0.1
    Python: 3.9.5
  Databases:
    SQLite: 3.32.2 - C:\Users\wagge\AppData\Local\Android\Sdk\platform-tools\sqlite3.EXE
  Browsers:
    Chrome: 107.0.5304.121
    Edge: Spartan (44.19041.1266.0), Chromium (107.0.1418.56)
    Internet Explorer: 11.0.19041.1566

 IDEs:
    Android Studio: Not Found
    Visual Studio: 17.3.32519.111 (Visual Studio Community 2022), 16.11.32106.194 (Visual Studio Community 2019)
  Languages:
    Java: 19.0.1
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.67.4 => 0.67.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
  • 更新 *

我运行了npm-update,它建议将sentry更新到4.10.1。完成后,我在package.json中看到了以下更改:

也称为Yarn锁

但是构建仍然会失败,并出现相同的错误。

  • 更新2*

我检查了podfile.*,看到了如下内容:

podfile.lock:

  - RNSentry (3.4.2):
    - React-Core
    - Sentry (= 7.11.0)
  - RNSnackbar (2.4.0):
    - React-Core
  - RNSVG (9.13.6):
    - React
  - Sentry (7.11.0):
    - Sentry/Core (= 7.11.0)
  - Sentry/Core (7.11.0)

文件podfile根本不包含“sentry”。

相关问题