Bundling Swift Libraries required by plugins failed for iOS Distribution Build

Have been testing our current project quite regularly by making development builds for our Apple Devices without any issues until now when I attempted to build for distribution via testFlight.

It reaches the final few steps of the build process and I get an error that swift libraries required by some plugins could not be bundled and the build fails. I have tried both Metal and non-Metal builds with the latest Solar2D build and an older one to no avail. With my development profile, the build goes through without issues.

The output on console where the process exits is below. I don’t know much about native iOS development so any help will be appreciated.

Codesigning libswiftDispatch.dylib at /Users//Desktop/Zombie Escape.app/Frameworks
/usr/bin/xcrun ‘–toolchain’ ‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain’ ‘codesign’ ‘–force’ ‘–sign’ ‘D46917ED42B7A0E4F3B49E97AEA7DC6D2539CA37’ ‘–verbose’ '/Users/
/Desktop/Zombie Escape.app/Frameworks/libswiftDispatch.dylib’
Warning: unable to build chain to self-signed root for signer “iPhone Distribution: (***)”
/Users/shashwat/Desktop/Zombie Escape.app/Frameworks/libswiftDispatch.dylib: errSecInternalComponent
*** error: Couldn’t codesign /Users/
/Desktop/Zombie Escape.app/Frameworks/libswiftDispatch.dylib: codesign failed with exit code 1
ERROR: build command failed: $(xcrun -f swift-stdlib-tool) --copy --verbose --sign D46917ED42B7A0E4F3B49E97AEA7DC6D2539CA37 --scan-executable "/Users/
/Desktop/Zombie Escape.app/Zombie Escape" --scan-folder “/Users//Desktop/Zombie Escape.app/Frameworks" --platform iphoneos --toolchain “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain” --destination "/Users//Desktop/Zombie Escape.app/Frameworks” --strip-bitcode --unsigned-destination “/var/folders/hh/c_kr1hs552q0jb07nngfr18h0000gn/T/CLtmpXXXXXX_SwiftSupport.Gpw6XGhI/SwiftSupport” && find “/Users/______/Desktop/Zombie Escape.app/Frameworks” -iname “libSwift*.dylib” -exec $(xcrun -f lipo) {} -remove arm64e -output {} ;
ERROR: with exit code 1 and output:
captureCommandOutput: cat /tmp/lua_GR2NWp

BUILD ERROR: ERROR: bundling Swift libraries required by plugins failed:
iOS build failed (2) after 88 seconds
ERROR: Build Failed: ERROR: bundling Swift libraries required by plugins failed:

If it helps, the build settings are as below:

settings =
{
	plugins =
    {
        ["CoronaProvider.native.popup.social"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },
        ["CoronaProvider.native.popup.activity"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true}
        },
        ["plugin.notifications.v2"] =
        {
            publisherId = "com.coronalabs"
        },
        ["plugin.google.iap.billing"] =
        {
            publisherId = "com.coronalabs"
        },
        ['plugin.vibrator'] = 
        {
            publisherId = 'com.fd'
        },
        ["plugin.googleAnalytics"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },  
        ["plugin.gpgs"] = {
            publisherId = "com.coronalabs",
            supportedPlatforms = {android = true}
        },
        ["CoronaProvider.gameNetwork.apple"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true }
        },
        ['plugin.att'] = 
        { 
            publisherId = 'com.solar2d' 
        },
         ["plugin.ironSource"] =
        {
          publisherId="tech.scotth",
          marketplaceId = "      ",
        },

        ["plugin.facebookIron"] = {
          publisherId = "tech.scotth",
          supportedPlatforms =
          {
             android = { url="http://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=facebook&type=Android" },
             iphone = { url="http://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=facebook&type=iOS" },
          }, 
        },
        
        ["plugin.reviewPopUp"] =
        {
            publisherId="tech.scotth",
            marketplaceId = "      ",
        },

        ['plugin.facebook.v4a'] = {
            publisherId = 'com.coronalabs'
        },
        
        ["plugin.applovinIron"] = {
             publisherId = "tech.scotth",
             supportedPlatforms =
             {
                 android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=applovin&type=Android" },
                 iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=applovin&type=iOS" },
             },
        },

    },

    splashScreen = 
    {
        enable = false
    },
	
	orientation =
	{
		-- Supported values for orientation:
		-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight

		default = "portrait",
		supported = { "portrait" }
	},
	
	excludeFiles =
	{
		-- Include only the necessary files on each platform, if "Icon.png" is for iphone then exclude it from android by adding it in the android table
        -- excludes files from builds for a specific platforms
		iphone = { "Icon-*dpi.png"},
		android = { "Icon.png", "Icon-Small-*.png", "Icon*@2x.png" },
        -- include only those files in this table which are to be excluded from all the platforms.
        all = {"Calling points.docx", "hostage.JPG", "player.JPG", "zombie.JPG"},
	},


	--
	-- iOS Section
	--
	iphone =
	{
        xcassets = "Images.xcassets",
        plist =
        {
            MinimumOSVersion= "11.0",
            UIStatusBarHidden = true,
            UIPrerenderedIcon = true, -- set to false for "shine" overlay
            UILaunchStoryboardName = "LaunchScreen",
            NSAppTransportSecurity = { NSAllowsArbitraryLoads=true },-- needed for appodeal
            NSBluetoothAlwaysUsageDescription = "This app would like to access bluetooth.",
            NSUserTrackingUsageDescription = "This will enable us to show targeted and more relevant, higher-quality ads to you.",
            CFBundleIdentifier = "com.famousdoggstudios.pg",
            SKAdNetworkItems = {{SKAdNetworkIdentifier = "SU67R6K2V3.skadnetwork"},{SKAdNetworkIdentifier = "ludvb6z3bs.skadnetwork"},{SKAdNetworkIdentifier = "v9wttpbfk9.skadnetwork"},{SKAdNetworkIdentifier = "n38lu8286q.skadnetwork"}}

        },

	},
	
}

try removing facebookIron and see if it works

I tried removing all plugins but that didn’t help. Eventually i checked keychain access and there was an error message on my distribution certificate which was resolved after i downloaded that Apple intermediate certificate or whatever it’s called

Builds work fine now. Couldn’t have worked this out based on the console log so luckily i decided to check keychain access. Thanks anyway

2 Likes

Hi. i have the same problem.
Which is the Apple intermediate certificate, how could i download?
Thanks