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

Could not build Objective-C module 'sentry_flutter' #2316

Open
sfolador opened this issue Sep 30, 2024 · 6 comments
Open

Could not build Objective-C module 'sentry_flutter' #2316

sfolador opened this issue Sep 30, 2024 · 6 comments
Assignees

Comments

@sfolador
Copy link

Platform

Flutter Mobile

Obfuscation

Disabled

Debug Info

Enabled

Doctor

puro flutter doctor -v
[!] Flutter (Channel stable, 3.24.3, on macOS 14.7 23H124 darwin-arm64, locale en-US)
• Flutter version 3.24.3 on channel stable at /Users/simone/.puro/envs/app_ios18/flutter
! Warning: flutter on your path resolves to /Users/simone/.puro/envs/stable/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at
/Users/simone/.puro/envs/app_ios18/flutter. Consider adding /Users/simone/.puro/envs/app_ios18/flutter/bin to the front of your path.
! Warning: dart on your path resolves to /Users/simone/.puro/envs/stable/flutter/bin/dart, which is not inside your current Flutter SDK checkout at
/Users/simone/.puro/envs/app_ios18/flutter. Consider adding /Users/simone/.puro/envs/app_ios18/flutter/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (3 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/simone/Library/Android/sdk
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
• Xcode at /Applications/Xcode-16.0.0.app/Contents/Developer
• Build 16A242d
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
• Android Studio at /Users/simone/Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] Connected device (6 available)
• SM T580 (mobile) • 52037cf346ee143b • android-arm • Android 8.1.0 (API 27)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 14 (API 34) (emulator)
• iPhone 15 (mobile) • 64A8AFA6-397E-483C-BEE9-054EB1636B78 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.7 23H124 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.7 23H124 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.70
! Error: Browsing on the local area network for Simone’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as
this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
• All expected network resources are available.

! Doctor found issues in 2 categories.

Version

8.9.0

Steps to Reproduce

When I launch puro flutter build ios from the terminal the build has success.

When launched from Xcode 16, i get an error.

Please mind that I've already tried with:

  • deleting Derived Data
  • updating Pods
  • cleaning Flutter project
  • updating pubspec
  • cleaning Xcode build folder (with xcodebuild clean or directly in Xcode)

Expected Result

The project should build from both terminal and Xcode.

Actual Result

I receive this error from Xcode 16 build:

/Users/simone/.puro/shared/pub_cache/hosted/pub.dev/sentry_flutter-8.9.0/ios/Classes/SentryFlutterReplayBreadcrumbConverter.h:1:9: note: while building module 'Sentry' imported from /Users/simone/.puro/shared/pub_cache/hosted/pub.dev/sentry_flutter-8.9.0/ios/Classes/SentryFlutterReplayBreadcrumbConverter.h:1:
@import Sentry;
^
:2:9: note: in file included from :2:
#import "Headers/Sentry-Swift.h"
^
/Users/simone/Library/Developer/Xcode/DerivedData/Runner-fjiefktzvsnoasawfjrslgcvjuvm/Build/Products/Release-iphonesimulator/Sentry/Sentry.framework/Headers/Sentry-Swift.h:1028:2: error: unsupported Swift architecture
#error unsupported Swift architecture
^
:1:9: note: in file included from :1:
#import "Headers/sentry_flutter-umbrella.h"
^
/Users/simone/Sites/apps/app_io18/app_io18/app_io18/ios/Pods/Target Support Files/sentry_flutter/sentry_flutter-umbrella.h:14:9: note: in file included from /Users/simone/Sites/apps/app_io18/app_io18/app_io18/ios/Pods/Target Support Files/sentry_flutter/sentry_flutter-umbrella.h:14:
#import "SentryFlutterReplayBreadcrumbConverter.h"
^
/Users/simone/.puro/shared/pub_cache/hosted/pub.dev/sentry_flutter-8.9.0/ios/Classes/SentryFlutterReplayBreadcrumbConverter.h:1:9: error: could not build module 'Sentry'
@import Sentry;
^
:0: error: could not build Objective-C module 'sentry_flutter'

Are you willing to submit a PR?

None

@buenaflor
Copy link
Contributor

thanks for the report, we'll have a look

@buenaflor
Copy link
Contributor

Have you tried this? #2303 (comment)

@sfolador
Copy link
Author

sfolador commented Oct 1, 2024

Have you tried this? #2303 (comment)

Hi, yes. I mentioned it in the "Steps to reproduce".

@buenaflor
Copy link
Contributor

In the terminal which xcode version is used? e.g with xcode-select is it also using xcode16?

@sfolador
Copy link
Author

sfolador commented Oct 1, 2024

Thanks.

This is the output of the xcode-select command:

xcode-select -p

/Applications/Xcode-16.0.0.app/Contents/Developer

So I suppose it's using Xcode 16 even in the terminal.

I just noticed that if i try to run the application from Xcode or Android Studio directly on an iOS device it works without any issue and also if I archive from Xcode.

It seems something related just to build / run with simulators.

@buenaflor
Copy link
Contributor

I'll have a look

@buenaflor buenaflor assigned denrase and unassigned martinhaintz Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

4 participants