Baffled in re how Swift packages defined in Xcode are handled in AppCode

I guess I'm looking for a "yes or no" on these questions.

If Xcode is used to add Swift package dependencies to a target, should I be able to build that target in AppCode?

I ask because I receive the following "Build system information" error when trying a build a target to which Xcode was used to add Swift package dependencies:

"Missing package product 'MobileFoo', please fix package resolution errors before building"

The same project builds fine in Xcode.

3 comments
Comment actions Permalink
Official comment

If you work with Xcode project and just added SPM target dependency for a target, you might need to resolve SPM dependencies manually.

You can do so by running "DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ xcodebuild -resolvePackageDependencies -IDECustomDerivedDataLocation=<AppCode project Derived Data>" from Xcode project folder, then reopen project in AppCode.

If that's the case, could you please try it and tell us if it helps?

Default AppCode Derived Data folder is: ~/Library/Caches/JetBrains/AppCode2020.1/DerivedData/<Your Project Name>-<some hash>

If there is custom settings for Derived Data, you can see so in Xcode File > Project Settings, or see what value is passed in Build Log.

We are working on proper SPM support at the moment, you can track progress via this ticket OC-19012

Comment actions Permalink

Thanks, Aleksandr,

I seem to be able to build now, but I'm having an odd issue where certain things in the SPM additions can't be resolved in AppCode. Everything builds fine, I just can't get protocol completions, etc.

I'll open a ticket for that.

Sorry to see this forum go, but as the post notes, it's really become more of a dumping ground for complaints and bug reports. ;)

-David

0
Comment actions Permalink

Hi David,

You are experiencing this problem with resolve because currently AppCode doesn't officially support swift packages inside Xcode projects, even though it's capable of building and running project with SPM dependencies.

We are currently working hard to deliver this feature asap. Here is corresponding ticket OC-19012, when it's done resolve to swift package's code as well as code completion will work.

0

Please sign in to leave a comment.