Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,28 @@ The Flutter SDK supports the following platforms:
We test the example app on Windows, macOS, and Linux to ensure cross-platform compatibility. CI runs
against Flutter `stable` and `beta` channels.

### Building the macOS example

On macOS, Flutter derives the local SwiftPM package identity from the plugin's directory basename
(`flutter`) rather than its pub name (`sentry_flutter`), so `flutter build macos` from
`packages/flutter/example` fails with:

```
unable to override package 'sentry_flutter' because its identity 'flutter'
doesn't match override's identity (directory name) 'sentry_flutter'
```

Use the helper script (or its melos alias), which temporarily renames the package directory to
`sentry_flutter`, builds, then restores it:

```bash
melos run build:macos-example
# or, forwarding extra flags to `flutter build macos`:
./scripts/build-macos-example.sh --debug
```

This only affects the macOS example build; iOS is unaffected.

## Native SDK Dependencies

The Flutter SDK embeds platform-specific native SDKs:
Expand Down
8 changes: 8 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ scripts:
flutter: true
dirExists: test

build:macos-example:
run: ./scripts/build-macos-example.sh --debug
description: >
Build the Flutter example for macOS. Temporarily renames packages/flutter
to packages/sentry_flutter so the SwiftPM package identity matches the pub
name on macOS, then restores it. Append extra `flutter build macos` flags
after `--`.

# Lifecycle script, executed as part of `melos clean`.
postclean: melos exec --flutter -- "flutter clean"

4 changes: 2 additions & 2 deletions min_version_test/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
platform :ios, '15.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -38,7 +38,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
6 changes: 3 additions & 3 deletions min_version_test/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -418,7 +418,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -467,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
17 changes: 6 additions & 11 deletions packages/flutter/example/integration_test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -741,17 +741,12 @@ void main() {

// Top-level iOS-specific sections
// integrations
expect(contexts.containsKey('integrations'), isTrue,
reason: 'Integrations section missing');
final integrations = contexts['integrations'];
expect(integrations, isA<List>());
expect((integrations as List), isNotEmpty);
expect(integrations.first, isA<String>());
final List<dynamic> integrationsList = integrations;
expect(integrationsList.contains('SentryCrashIntegration'), isTrue,
reason: 'Critical integration SentryCrashIntegration missing');
expect(integrationsList.contains('SentryReplayIntegration'), isFalse,
reason: 'SentryReplayIntegration should not be present');
// TODO(cocoa): sentry-cocoa 9 removed the API to enumerate installed
// native integrations, so they are no longer reported via loadContexts.
// Restore reporting and this assertion once cocoa exposes the installed
// integration names again (the cocoa team is adding the accessor).
expect(contexts.containsKey('integrations'), isFalse,
reason: 'Native integrations are not reported on sentry-cocoa 9');

// package info
expect(contexts.containsKey('package'), isTrue,
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '13.0'
platform :ios, '15.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -44,7 +44,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
18 changes: 9 additions & 9 deletions packages/flutter/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -495,7 +495,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -527,7 +527,7 @@
DEVELOPMENT_TEAM = 97JCY7859U;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -557,7 +557,7 @@
DEVELOPMENT_TEAM = 97JCY7859U;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = io.sentry.flutter.sample.RunnerTests;
Expand All @@ -584,7 +584,7 @@
DEVELOPMENT_TEAM = 97JCY7859U;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = io.sentry.flutter.sample.RunnerTests;
Expand Down Expand Up @@ -644,7 +644,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -694,7 +694,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -719,7 +719,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -752,7 +752,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/flutter/example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.15'
platform :osx, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -37,7 +37,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.15'
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -494,7 +494,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -541,7 +541,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions packages/flutter/ffi-cocoa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ language: objc
output: lib/src/native/cocoa/binding.dart
headers:
entry-points:
- ./temp/Sentry.framework/PrivateHeaders/PrivateSentrySDKOnly.h
- ./temp/Sentry.framework/Headers/PrivateSentrySDKOnly.h
- ./temp/Sentry.framework/Headers/Sentry-Swift.h
- ./temp/Sentry.framework/Headers/SentryId.h
compiler-opts:
- -DSENTRY_TARGET_PROFILING_SUPPORTED=1
- -DCOCOAPODS=1
Expand All @@ -16,5 +17,3 @@ objc-interfaces:
include:
- PrivateSentrySDKOnly
- SentryId
module:
'SentryId': 'Sentry'
6 changes: 3 additions & 3 deletions packages/flutter/ios/sentry_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Sentry SDK for Flutter with support to native through sentry-cocoa.
:tag => s.version.to_s }
s.source_files = 'sentry_flutter/Sources/**/*'
s.public_header_files = 'sentry_flutter/Sources/**/*.h'
s.dependency 'Sentry/HybridSDK', '8.58.3'
s.dependency 'Sentry', '9.17.1'
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.14'
s.ios.deployment_target = '15.0'
s.osx.deployment_target = '12.0'
Comment thread
buenaflor marked this conversation as resolved.

# Flutter.framework does not contain a i386 slice.
s.ios.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => '$(inherited) i386' }
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter/ios/sentry_flutter/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import PackageDescription
let package = Package(
name: "sentry_flutter",
platforms: [
.iOS("12.0"),
.macOS("10.14")
.iOS("15.0"),
.macOS("12.0")
],
products: [
.library(name: "sentry-flutter", targets: ["sentry_flutter", "sentry_flutter_objc"])
],
dependencies: [
.package(url: "https://github.com/getsentry/sentry-cocoa", exact: "8.58.3")
.package(url: "https://github.com/getsentry/sentry-cocoa", exact: "9.17.1")
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ public final class SentryFlutter {
"version": flutterSdk["version"]
], forKey: "sdkInfo")
}

// Sentry Flutter handles its own screenshot capture and masking in Dart,
// so it's not affected by Liquid Glass masking issues on iOS 26+.
options.experimental.enableSessionReplayInUnreliableEnvironment = true
}
#endif
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@_spi(Private) import Sentry

#if SWIFT_PACKAGE
import Sentry._Hybrid
import sentry_flutter_objc
#endif

Expand Down Expand Up @@ -215,9 +214,12 @@ public class SentryFlutterPlugin: NSObject, FlutterPlugin {
infos["user"] = ["id": PrivateSentrySDKOnly.installationID]
}

if let integrations = PrivateSentrySDKOnly.options.integrations {
infos["integrations"] = integrations.filter { $0 != "SentrySessionReplayIntegration" }
}
// swiftlint:disable:next todo
// TODO(cocoa): sentry-cocoa 9 removed `SentryOptions.integrations` and
// exposes no accessor for installed integration names, so we no longer
// report `infos["integrations"]`. Restore this (filtering out
// SentrySessionReplayIntegration) once cocoa exposes the installed
// integration names again (the cocoa team is adding the accessor).
Comment on lines +217 to +222

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create an issue for this as well for tracking


#if SENTRY_FLUTTER_SPM
infos["features"] = ["SwiftPackageManager"]
Expand Down Expand Up @@ -277,7 +279,7 @@ public class SentryFlutterPlugin: NSObject, FlutterPlugin {
let image = SentryDependencyContainer.sharedInstance().binaryImageCache
.imageByAddress(instructionAddress)
if let image = image {
let imageAddress = sentry_formatHexAddressUInt64(image.address)!
let imageAddress = String(format: "0x%016llx", image.address)
imagesAddresses.insert(imageAddress)
}
}
Expand All @@ -287,7 +289,8 @@ public class SentryFlutterPlugin: NSObject, FlutterPlugin {
.getDebugImagesForImageAddressesFromCache(imageAddresses: imagesAddresses) as [DebugMeta]
}
if debugImages.isEmpty {
debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
debugImages = SentryDependencyContainer.sharedInstance().debugImageProvider
.getDebugImagesFromCache() as [DebugMeta]
}

result(debugImages.map { $0.serialize() })
Expand Down
Loading
Loading