Appcenter: App Center SDK as a Swift Package for Xcode 11

Created on 7 Jun 2019  ·  34Comments  ·  Source: microsoft/appcenter

WWDC’19 is a fantastic event. Among other things, Apple is adding native support for Swift Packages to Xcode 11. This makes Swift Package Manager an officially supported package manager for third-party libraries on all platforms, including iOS. What’s your plan regarding CocoaPods, Carthage and the future of SDK? Thanks.

feature request sdk

Most helpful comment

+1 for Swift Package Manager support.
Currently AppCenter is the only dependency I have in the project which prevents me from migrating to SPM from CocoaPods.

All 34 comments

My suggestion would be to create multiple Swift packages, similar to your spec for CocoaPods. For example, a shared package AppCenter or AppCenterCore would include only generic classes for communicating with your Open API. Then separate packages like AppCenterAnalytics, AppCenterCrashes, AppCenterPush etc. would use that shared library as a transport. What do you think?

Thanks for getting in touch @shpakovski. I agree, this WWDC was one of a kind! It's true that AppCenterAnalytics, AppCenterCrashes, AppCenterPush etc. are dependent on AppCenter(core). Although if we look into details we can see that AppCenterDistribute won't be supported yet because resources are not yet supported by Swift Packages. AppCenterCrashes and AppCenterAuth are shipping their dependencies as binaries to simplify the integration. Since Swift Packages are not compatible with binaries we'd need to make these dependencies Swift Packages too. Also the way the frameworks are built today would need some remodeling. It's not trivial.

Hi @clpolet, thanks for the answer! As a Mac developer, I omitted non-trivial frameworks with resources. It seems possible to “package” the ones I mentioned. Although I understand the bigger picture. Let’s wait while SwiftPM adds support for bundles and resources 👍

My personal vote would be for an xcframework bundle. I'm working on a Catalyst Mac app at the moment but I'm having trouble linking against both the iOS and macOS framework bundles from the release archives from a single target.

@a2 From what I heard at WWDC, xcframeworks might not quite be ready yet for us. There is currently no support for distributing binaries (which is required for some of our dependencies) and no support for resource bundles, iirc.

AppCenter still doesn't work with MacCatalyst. Any news on this?

@marcocattai are you referring to the UIKit on macOS feature supported in Catalina? If so the answer is no the App Center iOS SDK doesn't run on Catalina. We are aware of the feature request but it's not planned yet.

Thank you for your answer Clpolet,

... not planned? lack of resources to allocate on it? Just a remembering, you are Microsoft guys!

We are already using HockeyApp/now Appcenter.ms to track crashes on iOS ...the fact that the Catalina version is not even planned is very disappointing.

@marcocattai I understand your concerns. We will discuss this internally and add this in future plans. I will not be able to commit an ETA but you can track this through this issue.

Let's try to keep each feature separate. I replied to @marcocattai in the dedicated feature: microsoft/appcenter-sdk-apple#1745 .
I am removing the not planned label because it seems that it doesn't convey the right message.

@clpolet Hello 👋 As you have added support for Carthage, would it be possible to “wrap” all frameworks into Package.swift? This would make Xcode integration even better! Thanks in advance.

Hello @shpakovski, having framework targets is definitely a step forward :). Though there are still quite some work to do for instance enabling SPM for the SDK dependencies on Crashes and Auth but also waiting for bundle support on SPM for Distribute.

Hi @clpolet Understandable but you could start small e.g. most apps need only AppCenter, Crashes and Analytics. This way you could also verify how this works 🙂

+1 for Swift Package Manager support.
Currently AppCenter is the only dependency I have in the project which prevents me from migrating to SPM from CocoaPods.

Hey guys, is there any update on this? It would be fantastic for this to be offered.

@rodrigoelp I am transferring this issue to AppCenter Central Repository where all the new feature requests are being tracked and prioritized. Thanks

Is there any update in this feature ?

We would also like to see Swift Package Manager support for App Center.

Hey Microsoft 👋 Any (good) news? Is this even in plans? Thanks.

Is there any update?

This is under active consideration. We will share more details once we get approval and the team moves into implementation phase.

Any update on this?

AppCenter is the only pod in my Podfile now.

Thanks for the feedback and the votes. We are seriously looking into it. I will share an update soon. Thanks

The team has picked this up and are now evaluating it. There are few limitations and we might have to release this in phases. I will share an update once the evaluation is complete.

Hi there,
The feature has been merged to develop branch, so you can already try it. This will be included in the next SDK release. The feedback is always welcome.

Thanks

@MatkovIvan Is this still in beta?

@kaunteya there are no releases with it yet, so you need to specify branch or commit hash for now. You can treat this as a beta, yes.

I just tried this by specifying the master branch in Xcode 11.4.1:

ac1

...but I'm getting an error:

ac2

Do I have to specify a branch other than master?

Hi there,
The feature has been merged to develop branch, so you can already try it. This will be included in the next SDK release. The feedback is always welcome.

Thanks

Try develop branch

Thanks for your quick reply, @kaunteya. I just tried that and get a different error now. :) Do I need to specify a particular commit?

I have:

  1. Removed the Carthage version of App Center
  2. Deleted derived data
  3. Restarted Xcode

Any ideas?

ac-develop
ac-error

I figured it out. You have to use the Apple SDK repo path.

Repository: https://github.com/microsoft/appcenter-sdk-apple
Branch: : develop

I can see this has been released as part of v3.2.0, but I can't find any documentation for the feature. I'm seeing the following error when I attempt to build a macOS app target that integrates both dependencies:

Screen Shot 2020-05-25 at 14 28 11

Hi there,

This has been released in 3.2.0.

@tonyarnold documentation changes are already merged and will be published soon.
Regarding "cyclic" dependencies - core module doesn't have this dependency for sure. I saw the similar issues in Xcode because of "Find Implicit Dependencies" checkbox (Edit scheme -> Build), please try to disable it. If the problem persists - please open a new issue in the apple repo, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

busterlaursen picture busterlaursen  ·  4Comments

sindresorhus picture sindresorhus  ·  3Comments

chriskellor picture chriskellor  ·  3Comments

KSemenenko picture KSemenenko  ·  3Comments

comply365dev picture comply365dev  ·  4Comments