Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue where the SPM package doesn't compile with Xcode 11.4 #368

Merged
merged 4 commits into from
Aug 24, 2020

Conversation

akmarinov
Copy link
Contributor

After updating to Xcode 11.4, my project is showing the following issue with RxBluetoothKit:

xcodebuild: error: Could not resolve package dependencies:
   target at '/Users/xcode/Library/Developer/Xcode/DerivedData/project-btxgpemzyyretjcousmtwoebmywz/SourcePackages/checkouts/RxBluetoothKit' contains mixed language source files; feature not supported

I've been able to track down the error to the Info.plist file in the Sources folder.

For whatever reason, Xcode 11.4 now doesn't like that there's a file that's not a .swift one. (Xcode 11.3.1 still works fine)

I've included that file in the excluded section in the package description, which solves the issue.

@DevAndArtist
Copy link
Contributor

DevAndArtist commented Mar 27, 2020

@akmarinov are you sure it's only Info.plist? The Sources folder does also contain RxBluetoothKit.h. I'd say SPM would still consider this as mixed languages. We should exclude this file as well, just in case.

This PR would resolve: #368

@akmarinov
Copy link
Contributor Author

akmarinov commented Mar 27, 2020

Well, Xcode works in mysterious ways, as the ObjC compatibility header doesn't seem to be an issue in my case.

// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "TestProject",
    platforms: [
        .iOS("12.4")
    ],
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "TestProject",
            targets: ["TestProject"]),
    ],
    dependencies: [
        .package(url: "https://github.com/akmarinov/RxBluetoothKit.git", from: "5.3.1"),
        .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.1.0")
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "TestProject",
            dependencies: ["RxBluetoothKit", "RxSwift"],
            path: "Sources")
    ]
)

These package dependencies in a test project work without Xcode showing the issue for me, with the RxBluetoothKit.h included.

I'm not sure what the impact of turning off the compatibility header would be for ObjC projects, but excluding it in the SPM package shouldn't be an issue.

@DevAndArtist
Copy link
Contributor

DevAndArtist commented Mar 27, 2020

excluding it in the SPM package shouldn't be an issue

That's my whole point. :)

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2020

CLA assistant check
All committers have signed the CLA.

Copy link

@tomovicn tomovicn left a comment

Choose a reason for hiding this comment

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

This fixes an issue.

@tomovicn
Copy link

@DevAndArtist can you approve this pull request? Or who should we ping?
This is a blocker for all of us who use SPM.

@DevAndArtist
Copy link
Contributor

DevAndArtist commented May 19, 2020

@tomovicn I'm just a contributor to the framework (I added some changes to the logging stuff in the past), but not part of Polidea so I can't really approve the PR. Personally I consider this framework as dead and will try to get rid of its dependency in our projects.

Your best chances right now are to fork the project and merge this PR in your fork and re-route the dependencies.

@tomovicn
Copy link

It's a shame since it is a very good library. I dropped them a message to see if they still support this project.
Thanks for your response @DevAndArtist

@minixT minixT merged commit 267530a into Polidea:master Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants