What Happened and How Do I Fix It?


Rick Aurbach
 

Xcode 13.0ß3, project has a single target (set up as an app).

I moved some files from the main project to a local SPM package and when Xcode has some problems with that, I deleted the app's folder in DerivedData.

Restarted Xcode, let it resolve dependencies, index, etc. Then attempted to build.

I now get errors (see attached) which seem to indicate that Xcode thinks I'm suddenly developing an application extension instead of an application. Don't know why this happened or how to fix it. Any thoughts??



Alex Zavatone
 

What do your app’s settings indicate?

On Jul 20, 2021, at 12:47 PM, Rick Aurbach via groups.io <rlaurb=me.com@groups.io> wrote:

<Capto_Capture 2021-07-20_12-37-54_PM.png>


Rick Aurbach
 

It all looks normal to me...(but what do I know?)


Rick Aurbach
 

Oh, yes... and from the project's "project.pbxproj" file (notice that product-type is 'application'),

/* Begin PBXNativeTarget section */
        69421F382653228F0031DC82 /* WineCorner */ = {
            isa = PBXNativeTarget;
            buildConfigurationList = 69421F50265322910031DC82 /* Build configuration list for PBXNativeTarget "WineCorner" */;
            buildPhases = (
                69421F352653228F0031DC82 /* Sources */,
                69421F362653228F0031DC82 /* Frameworks */,
                69421F372653228F0031DC82 /* Resources */,
            );
            buildRules = (
            );
            dependencies = (
            );
            name = WineCorner;
            packageProductDependencies = (
                69421F60265325E10031DC82 /* Extensions */,
                69421F62265325E10031DC82 /* iOSLib */,
                69D1858F267C0565008FE9D8 /* DropDownObjects */,
                69EF266326892A4B00FC8367 /* CoreDataStack */,
                691483AC269F8BE000C3976A /* DropDownObjectsCD */,
            );
            productName = WineCorner;
            productReference = 69421F392653228F0031DC82 /* WineCorner.app */;
            productType = "com.apple.product-type.application";
        };
/* End PBXNativeTarget section */


Ben Kennedy
 

Is the build setting APPLICATION_EXTENSION_API_ONLY (“Require Only App-Extension-Safe API”) enabled anywhere?

b

On 20 Jul 2021, at 11:57 am, Rick Aurbach via groups.io <rlaurb=me.com@groups.io> wrote:

It all looks normal to me...(but what do I know?)
<Capto_Capture 2021-07-20_01-53-05_PM.png><Capto_Capture 2021-07-20_01-53-48_PM.png><Capto_Capture 2021-07-20_01-55-14_PM.png>


Rick Aurbach
 

On Tue, Jul 20, 2021 at 02:25 PM, Ben Kennedy wrote:
APPLICATION_EXTENSION_API_ONLY
Not that I can find. Entering this string into the searchBar of Build Settings finds nothing.


Rick Aurbach
 

Just one more thing...

It turns out that all of the errors that I'm referring to here occur while compiling local SPM packages. I'm beginning to think that this is:
(a) yet another bug with the Xcode implementation of SPM. (If so, it's the fourth [or so; hard to keep count] that I've uncovered. 
(b) another reason to give up on SPM as a good idea whose implementation is fatally flawed.

Honestly, I've invested months on refactoring my entire development environment to use SPM for local packages, and I am about ready to chuck it. I will waste less time by undoing my reliance on SPM than I will trying to get things to work with Xcode.


Jonathan Prescott
 

It’s “Require Only Application-Extension-Safe API”
Jonathan

On Jul 20, 2021, at 3:37 PM, Rick Aurbach via groups.io <rlaurb@...> wrote:

On Tue, Jul 20, 2021 at 02:25 PM, Ben Kennedy wrote:
APPLICATION_EXTENSION_API_ONLY
Not that I can find. Entering this string into the searchBar of Build Settings finds nothing.


Rick Mann
 

I may have missed previous emails that specified this, but I'm using SPM dependencies exclusively, and running into issues that (mostly) have workarounds.

As of Xcode 13b3/iOS 15b3, more APIs have been marked as not available to application extensions, which broke one of the SPM dependencies we have.

In b2, Apple made some AVFoundation results no longer `Unmanaged`, which breaks our code (which must still compile under Xcode 12.5.1). It's not clear to me if code written with the iOS 15 SDK can operate on iOS 14

The "workaround" is to stick to 13b1.

Lastly, switching between 12.5.1 and 13 requires us to "reset package caches" (File menu) every time we switch.

On Jul 21, 2021, at 08:26 , Rick Aurbach via groups.io <rlaurb=me.com@groups.io> wrote:

Just one more thing...

It turns out that all of the errors that I'm referring to here occur while compiling local SPM packages. I'm beginning to think that this is:
(a) yet another bug with the Xcode implementation of SPM. (If so, it's the fourth [or so; hard to keep count] that I've uncovered.
(b) another reason to give up on SPM as a good idea whose implementation is fatally flawed.

Honestly, I've invested months on refactoring my entire development environment to use SPM for local packages, and I am about ready to chuck it. I will waste less time by undoing my reliance on SPM than I will trying to get things to work with Xcode.
--
Rick Mann
rmann@latencyzero.com


Rick Aurbach
 

I just backed off Xcode 13.0ß3 and moved back to ß2. I'm compiling again. BUT...

(1) I don't know why the local SPM packages should have been compiled with the APPLICATION_EXTENSION_API_ONLY flag. The flag is not set anywhere in the project.
(2) There have been a lot of problems with Xcode's implementation of SPM which are (at least partially) due to having absolutely no control over package compilation.
(3) Every time the Xcode team fixes something related to SPM, it seems like they either reveal or introduce new bugs. Based on the problems I've been having over the past year, I am having some serious issues with what aspects of the feature set are included in their test suites. (And please understand that I mean no disrespect. Xcode is an outstanding achievement. But I've reported a half-dozen or so common use-cases that don't work at all [and hence must not be included in their test suite.])

I wish I had an estimate of the amount of time I've wasted trying to use features which are purported to work regarding SPM. It's certainly at least 3 man-months. Probably more.

– frustrated in St. Louis