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 running with Android Studio IDE #1781

Closed
koemheangHQ opened this issue Dec 12, 2023 · 11 comments · Fixed by getsentry/sentry-cocoa#3538
Closed

Cannot running with Android Studio IDE #1781

koemheangHQ opened this issue Dec 12, 2023 · 11 comments · Fixed by getsentry/sentry-cocoa#3538

Comments

@koemheangHQ
Copy link

Platform

Dart

Obfuscation

Enabled

Debug Info

Enabled

Doctor

flutter clean
flutter run --verbose
flutter pub get
flutter doctor -v

dart versions :3.0.5
flutter version: 3.13.6

Version

7.13.2

Steps to Reproduce

Just install library sentry version 7.13.2 and running with flutter SDK 3.13.6 and dart version 3.0.5, but it showing message like this:

Modules Issue (Xcode): Import of C++ module 'Darwin.Mach' appears within extern "C" language linkage specification /Users/xxx/xxx/Projects/flutter_project/ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.h:35:0

Modules Issue (Xcode): Import of C++ module 'Darwin.POSIX.sys.types' appears within extern "C" language linkage specification /xxx/xxx/Desktop/Projects/flutter_project/ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashStackCursor.h:35:0

Expected Result

I'm expected it should be working find, but cannot running

Actual Result

showing message like this:
Modules Issue (Xcode): Import of C++ module 'Darwin.Mach' appears within extern "C" language linkage specification /Users/xxx/xxx/Projects/flutter_project/ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.h:35:0

Modules Issue (Xcode): Import of C++ module 'Darwin.POSIX.sys.types' appears within extern "C" language linkage specification /xxx/xxx/Desktop/Projects/flutter_project/ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashStackCursor.h:35:0

Are you willing to submit a PR?

None

@buenaflor
Copy link
Contributor

Hi

did you use sentry without errors on android studio before?

@koemheangHQ
Copy link
Author

Hi

did you use sentry without errors on android studio before?

Xcode version 14.3.1 was working fine. After upgrade macos Somona and upgrade to Xcode 15, it is not working.

@ThyrithSor
Copy link

I also have this issue .This is my temporary solution:

Navigate to ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.h and make the following change:

// Add this line about extern "C"
#include <mach/mach.h>.  // <---- add this

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>
//#include <mach/mach.h> //<----- remove this

Navigate to ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashThread.h and make the following change:

#define HDR_SentryCrashThread_h

// Add this
#include <stdint.h> // <------ add this

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>
// #include <sys/types.h> //<------- Remove this

Navigate to ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashStackCursor.h and make the following change:

#include <stdint.h> // <------- add this

#ifdef __cplusplus
extern "C" {
#endif

#include "SentryCrashMachineContext.h"

#include <stdbool.h>
//#include <sys/types.h> //<------- Remove this

@buenaflor
Copy link
Contributor

We've released 7.14.0 which includes a bump in the cocoa version. Can you check if this is still a problem without the temporary solution?

@ThyrithSor
Copy link

@buenaflor

After updating the plugin to 7.14.0 and Sentry/HybridSDK (8.17.2) on pod, the problem still exists.

Screenshot 2023-12-22 at 8 49 40 in the morning

@buenaflor
Copy link
Contributor

buenaflor commented Dec 22, 2023

Got it, any luck with deleting the pods folder and running pod install?

Can't reproduce it locally unfortunately, I'm running on xcode 15.1 and sonoma as well

@ThyrithSor
Copy link

@buenaflor, after deleted pods folder, I got the same error.

My Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.9, on macOS 14.2 23C64 darwin-arm64, locale en-KH)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (4 available)
[✓] Network resources

@buenaflor
Copy link
Contributor

That's very odd. @philipphofmann maybe you know more context here?

@brustolin
Copy link
Collaborator

@koemheangHQ could you try adding this to your project Podfile to see if it works:

pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :branch => 'fix/c-extern'

@koemheangHQ
Copy link
Author

@brustolin Now It's working.

@kahest
Copy link
Member

kahest commented Jan 9, 2024

@koemheangHQ thanks for reporting back, we have a tentative fix PR incoming. @ThyrithSor did you find time to test this as well?

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
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants