14.5 C
New York
Tuesday, March 18, 2025

ios – XCode Share and Widget Extensions not working after including native SPM bundle


Introduction of downside

This not too long ago began occurring once I added an inner bundle with shared code throughout principal app and extensions. Once I load the simulator by both setting our principal app because the goal or as the person extensions, the extensions don’t present up on the simulator. Once I construct and run the share extension to images, our app’s choice doesn’t present as much as share regardless of being a possible picture share goal. Once I run the widget extension, the choice so as to add our app’s widget doesn’t present up. These have been working fantastic on my companion’s units earlier than I added the shared bundle. Now it does not work on any of our units

enter image description here

Embedded binary just isn’t signed with the identical certificates because the guardian app

There’s one other bug that I’ve not too long ago stumbled throughout once I added the shared bundle. That’s
Embedded binary just isn’t signed with the identical certificates because the guardian app. Confirm the embedded binary goal’s code signal settings match the guardian app’s.
The logs present that this error occurs when constructing the widget extension. This construct error goes away once I allow Copy solely when putting in

The option that I pressed to enable/disable the above bug

The extensions have been working simply fantastic earlier than the bundle was added.

I initially thought it was a signing downside, however then we triple checked and acquired a correct Apple Growth Crew with Certs but it nonetheless does not work. I’ve set the interior bundle as a static bundle. As a aspect word, the interior bundle just isn’t explicitly signed (which I do not know tips on how to do). Nonetheless it’s added as a static library within the Frameworks, Libraries, and Embedded Content material part of each principal app and extensions (lest the imports do not work)
Main app

Widget Extension

Share Extension

Beneath is the Bundle.swift file of my bundle

// swift-tools-version: 6.0
// The swift-tools-version declares the minimal model of Swift required to construct this bundle.

import PackageDescription

let bundle = Bundle(
    identify: "TwoCentsInternal",
    platforms: [
        .iOS(.v18)
    ],
    merchandise: [
        .library(
            name: "TwoCentsInternal",
            type: .static,  // <-- This line specifies a static library.
            targets: ["TwoCentsInternal"]),
    ],
    dependencies: [
        .package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.9.0")
    ],
    targets: [
        .target(
            name: "TwoCentsInternal",
            dependencies: [
                // Specify the Firebase products you need.
                .product(name: "FirebaseCore", package: "firebase-ios-sdk"),
                .product(name: "FirebaseAuth", package: "firebase-ios-sdk")
            ]
        ),
    ],
    swiftLanguageModes: [.v6]
)

Beneath is are the Information.plists for my Share extension and Widget extension respectively





    NSExtension
    
        NSExtensionAttributes
        
            NSExtensionActivationRule
            
            NSExtensionActivationSupportsImageWithMaxCount
            5
            NSExtensionActivationSupportsMovieWithMaxCount
            5
            NSExtensionActivationSupportsText
            
            NSExtensionActivationSupportsWebURLWithMaxCount
            1
        
        NSExtensionMainStoryboard
        MainInterface
        NSExtensionPointIdentifier
        com.apple.share-services
    






    NSExtension
    
        NSExtensionPointIdentifier
        com.apple.widgetkit-extension
    


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles