Skip to content
Open
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
29 changes: 14 additions & 15 deletions libraries/flutter_inapp_purchase/Package.swift
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "flutter_inapp_purchase",
platforms: [
.iOS("12.0")
.iOS("15.0"),
.macOS("14.0"),
],
products: [
.library(name: "flutter-inapp-purchase", targets: ["flutter_inapp_purchase"])
.library(name: "flutter_inapp_purchase", targets: ["flutter_inapp_purchase"]),
],
dependencies: [
.package(
url: "https://github.com/hyodotdev/openiap.git",
exact: "2.2.1"
),
],
dependencies: [],
targets: [
.target(
name: "flutter_inapp_purchase",
dependencies: [],
path: "ios/Classes",
resources: [
.process("../Assets")
dependencies: [
.product(name: "OpenIAP", package: "openiap"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The package name for the OpenIAP dependency should likely be 'OpenIAP' (matching the product name) rather than 'openiap'. Please verify the package name defined in the dependency's Package.swift.

Suggested change
.product(name: "OpenIAP", package: "openiap"),
.product(name: "OpenIAP", package: "OpenIAP"),

],
publicHeadersPath: "",
cSettings: [
.headerSearchPath("../Flutter"),
.headerSearchPath("../../../Flutter/Export")
]
)
path: "ios/Classes"
),
]
Comment on lines 17 to 25
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Locate all Package.swift manifests for this plugin and inspect their dependencies/paths.
fd -t f 'Package.swift' libraries/flutter_inapp_purchase --exec sh -c 'echo "==== {} ===="; cat "{}"'

# Confirm the target sources actually import Flutter modules.
rg -nP 'import\s+(Flutter|FlutterMacOS)|canImport\(FlutterMacOS\)' libraries/flutter_inapp_purchase/ios/flutter_inapp_purchase/Sources -C1

Repository: hyodotdev/openiap

Length of output: 4563


Root Package.swift is missing FlutterFramework dependency for sources that import Flutter/FlutterMacOS

The root libraries/flutter_inapp_purchase/Package.swift target depends only on OpenIAP:

targets: [
    .target(
        name: "flutter_inapp_purchase",
        dependencies: [
            .product(name: "OpenIAP", package: "openiap"),
        ],
        path: "ios/flutter_inapp_purchase/Sources/flutter_inapp_purchase"
    )
]

…but the corresponding sources libraries/flutter_inapp_purchase/ios/flutter_inapp_purchase/Sources/flutter_inapp_purchase/FlutterInappPurchasePlugin.swift contain import FlutterMacOS / import Flutter. The platform-specific manifests in libraries/flutter_inapp_purchase/ios/flutter_inapp_purchase/Package.swift and libraries/flutter_inapp_purchase/macos/flutter_inapp_purchase/Package.swift add the needed FlutterFramework dependency, while the root manifest does not.

If the root manifest is no longer used, remove it to avoid divergence; otherwise add FlutterFramework (package + product) to the root target so it can resolve Flutter/FlutterMacOS.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libraries/flutter_inapp_purchase/Package.swift` around lines 17 - 25, The
root Package.swift target "flutter_inapp_purchase" is missing the
FlutterFramework dependency required by sources that import Flutter/FlutterMacOS
(see FlutterInappPurchasePlugin.swift); either remove the root Package.swift if
it's unused to avoid divergence, or add the FlutterFramework package+product to
the target's dependencies (mirror what the platform-specific Package.swift files
do) so the target resolves imports of Flutter/FlutterMacOS.

)
)