PostHog / posthog-flutter

PostHog Flutter SDK
https://posthog.com/docs/libraries/flutter
MIT License
55 stars 37 forks source link

Build fails in macOS Flutter 3.24.3 #115

Closed KingkorAtMaxint closed 2 months ago

KingkorAtMaxint commented 2 months ago

Version

4.5.0

Steps to Reproduce

  1. Any flutter project (make sure flutter >=3.24.3)
  2. Add posthog_flutter: ^4.5.0 as dependency
  3. Initialize and use posthog according to the docs
  4. Run using the Flutter VSCode extension and select the macOS as device
  5. Experience the exceptions as build fails

Expected Result

To work with macOS Flutter 3.24.3 without any exception and crash

Actual Result

Fails to build (debug/release) and throws these exceptions

Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:, name:My Mac }
{ platform:macOS, arch:x86_64, id:, name:My Mac }
<project dir>/macos/Pods/PostHog/PostHog/PostHogSwiftUIViewModifiers.swift:19:45: error: 'View' is only available in macOS 10.15 or newer
        func body(content: Content) -> some View {
                                            ^
        func body(content: Content) -> some View {
             ^
    struct PostHogSwiftUIViewModifier: ViewModifier {
           ^
<project dir>/macos/Pods/PostHog/PostHog/PostHogSwiftUIViewModifiers.swift:32:76: error: 'View' is only available in macOS 10.15 or newer
                               _ properties: [String: Any]? = nil) -> some View
                                                                           ^
        func postHogScreenView(_ screenName: String? = nil,
             ^
    public extension View {
           ^
<project dir>/macos/Pods/PostHog/PostHog/PostHogSwiftUIViewModifiers.swift:41:74: error: 'View' is only available in macOS 10.15 or newer
                             _ properties: [String: Any]? = nil) -> some View
                                                                         ^
        func postHogViewSeen(_ event: String,
             ^
    public extension View {
           ^
<project dir>/macos/Pods/PostHog/PostHog/PostHogSwiftUIViewModifiers.swift:30:22: error: 'View' is only available in macOS 10.15 or newer
    public extension View {
                     ^
    public extension View {
           ^
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

Error: Build process failed

Exited (1).
KingkorAtMaxint commented 2 months ago

Sorry, this was due to our deployment target being set to 10.14 in xcproject where in macos/Podspec it's 10.15 which confused us thinking may be the plugin has something below 10.15 set