Skip to content

Issue building with Carthage on Xcode 12 #1

@mickael-menu

Description

@mickael-menu

UPDATE: This has been fixed in Carthage, which can now build with Xcode 12 using:

carthage update --use-xcframeworks --platform ios

However, you need to make sure that you use the latest version of Readium, from the develop branch.


There's currently an issue with Xcode 12 when trying to build Carthage dependencies. Unfortunately, it's not something we can address in Readium.

If you don't want to stick with Xcode 11, a workaround until Carthage is fixed is to use the following script instead of the regular Carthage command:

#!/usr/bin/env bash

# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"

Add it to /usr/local/bin, chmod a+x carthage.sh and then you can use it like that: carthage.sh update --platform ios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions