Reputation: 13240
I want to migrate my CocoaPods to Swift Package Manager.
I'm getting the following error if I add Objective c Framework using SwiftPM
'RSKImageCropper/RSKImageCropper.h' file not found
If I install the framework using pods, everything runs fine.
pod 'RSKImageCropper', '~> 3.0.2'
What should i do to solve this error?
Upvotes: 1
Views: 3754
Reputation: 13240
Package.swift of RSKImageCropper
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "RSKImageCropper",
platforms: [.iOS(.v9)],
products: [
.library(
name: "RSKImageCropper",
targets: ["RSKImageCropper"]),
],
targets: [
.target(
name: "RSKImageCropper",
path: "RSKImageCropper",
resources: [
.copy("RSKImageCropperStrings.bundle")
],
publicHeadersPath: "include"
),
]
)
Only headers in include folder is public and visible (publicHeadersPath key). Fixed by changing
#import <RSKImageCropper/RSKImageCropper.h>
to
#import <RSKImageCropper/RSKImageCropViewController.h>
Upvotes: 4