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

Cannot build for ios simulator with Apple M1 macbook #252

Closed
jamesmcb opened this issue Jan 25, 2022 · 5 comments · Fixed by #262
Closed

Cannot build for ios simulator with Apple M1 macbook #252

jamesmcb opened this issue Jan 25, 2022 · 5 comments · Fixed by #262

Comments

@jamesmcb
Copy link

Environment

Using sentry-cordova 1.0.0 for an ionic project with Xcode 13 on a macbook pro with an M1 Processor.

Ionic:

Ionic CLI : 6.18.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.9.3
@angular-devkit/build-angular : 0.803.29
@angular-devkit/schematics : 8.3.29
@angular/cli : 8.3.29
@ionic/angular-toolkit : 5.0.3

Cordova:

Cordova CLI : 11.0.0
Cordova Platforms : android 8.1.0, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 5.0.0, (and 16 other plugins)

Utility:

cordova-res : 0.15.4
native-run (update available: 1.5.0) : 0.2.9

System:

ios-sim : 8.0.2
NodeJS : v16.13.2 (/usr/local/bin/node)
npm : 8.1.2
OS : macOS Monterey
Xcode : Xcode 13.2.1 Build version 13C100

Steps to Reproduce

  1. Run ionic cordova build ios

Expected Result

It would build

Actual Result

ld: warning: building for iOS Simulator, but linking in dylib built for iOS, 'Sentry.framework'
ld: warning: Could not find or use auto-linked framework 'Sentry'
Undefined symbols for architecture arm64:
"OBJC_CLASS$_SentryUser", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryBreadcrumb", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryEnvelope", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryEnvelopeItem", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryEnvelopeItemHeader", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryEnvelopeHeader", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentrySdkInfo", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryId", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentrySDK", referenced from:
objc-class-ref in SentryCordova.o
"OBJC_CLASS$_SentryOptions", referenced from:
objc-class-ref in SentryCordova.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@bruno-garcia
Copy link
Member

What's the min version of Sentry Cocoa with support for M1 @philipphofmann ?

@philipphofmann
Copy link
Member

If I remember correctly, we didn't have any significant issues with M1. Apple released the first M1 Macs in November 2020. Just to be safe I would pick 6.1.0 for the min version which we released in January 2021.

@philipphofmann
Copy link
Member

From the error message I see that this is a problem with linking. As we are using Carthage to include sentry-cocoa, I think we should update to 7.2.0 in which we fixed an issue for Carthage with XCFrameworks.

@bruno-garcia
Copy link
Member

@lucas-zimerman is this something you can help us with? We might need to bump the dependency and runs some tests

@lucas-zimerman
Copy link
Collaborator

lucas-zimerman commented Apr 18, 2022

running on iOS simulator seems to trigger this error even if you update sentry-cocoa, on the other hand, when targeting the device itself the error seems to be gone (M1)

EDIT: I might have spotted the issue, I'll do further tests and we may get a new version soon 🙂

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

Successfully merging a pull request may close this issue.

4 participants