scenee / FloatingPanel

A clean and easy-to-use floating panel UI component for iOS
MIT License
5.54k stars 498 forks source link

Module 'FloatingPanel' not found #517

Open 0xMarK opened 2 years ago

0xMarK commented 2 years ago

Description

I was replacing cocoapods with SPMs and encountered Swift Compiler Errors:

/Users/ios.developer/Library/Developer/Xcode/DerivedData/client-ios-aslyravufwuynvasnzjlelwytgmd/Build/Products/ProdDebug-iphonesimulator/MyFramework.framework/Headers/MyFramework-Swift.h:192:9:
Module 'FloatingPanel' not found

and

<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "Headers/MyFramework-Swift.h"
        ^
/Users/ios.developer/Library/Developer/Xcode/DerivedData/client-ios-aslyravufwuynvasnzjlelwytgmd/Build/Products/ProdDebug-iphonesimulator/MyFramework.framework/Headers/MyFramework-Swift.h:192:9: error: module 'FloatingPanel' not found
@import FloatingPanel;
        ^
<unknown>:0: error: could not build Objective-C module 'MyFramework'
Screenshot 2021-11-27 at 12 37 38 Screenshot 2021-11-27 at 12 45 53

Please note that I have the main target and the list of frameworks. In one of those frameworks (MyFramework) I use FloatingPanel. MyFramework has Objetive-C class SVPrivateScrollDelegateProxy and I had to import it in MyFramework.h:

#import <Foundation/Foundation.h>

//! Project version number for MyFramework.
FOUNDATION_EXPORT double MyFrameworkVersionNumber;

//! Project version string for MyFramework.
FOUNDATION_EXPORT const unsigned char MyFrameworkVersionString[];

#import "SVPrivateScrollDelegateProxy.h"

Expected behavior

FloatingPanel works as earlier.

Actual behavior

I can't build the project because there is a Swift Compiler Error.

Steps to reproduce

  1. Remove the cocoapod FloatingPanel.
  2. Add the SPM FloatingPanel with standard procedure.
  3. Add the FloatingPanel to Project -> MyFramework -> General -> Frameworks and Libraries.
  4. Run

Code example that reproduces the issue This is how the FloatingPanel is being imported to places of usage:

import WebKit
import FloatingPanel

public final class CatalogWebViewController:  BaseViewController, АFloatingController {
    private var webView: WKWebView!
    private var webManager: CatalogWebManager!

How do you display panel(s)?

How many panels do you displays?

Environment

Library version 2.5.0

Installation method

iOS version(s) iOS 15.0

Xcode version 13.1

scenee commented 2 years ago

I tested SwiftPM on 2.5.0 in Xcode 13.1, but it works well.

0xMarK commented 2 years ago

@scenee I've added more details to the current issue. Take a look.

I'm confused by the wording "could not build Objective-C module 'MyFramework'". MyFramework is not Objective-C it has one Obj-C class and that's it.

I'll tell you more: I made a refactoring and I removed the only Objective-C class from my Project. And still I get the same Error.

Maybe there is a problem in pod 'YandexMapsMobile'? Developers haven't yet upgraded it to Swift and haven't made it SPM.

Here is my Podfile:

platform :ios, '12.0'
use_frameworks!
inhibit_all_warnings!

target 'MyProject' do
  pod 'SwiftGen', '~> 6.0'
  pod 'pop', :git => 'https://github.com/facebook/pop.git'
  pod 'ReCaptcha'
#  pod 'FloatingPanel'
  pod 'DBDebugToolkit'
  pod 'Mindbox'
end

target 'Services' do
  pod 'YandexMapsMobile', '4.0.0-full'
end

target 'MyFramework' do
  pod 'ReCaptcha'
#  pod 'FloatingPanel'
end