facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.78k stars 3.54k forks source link

Carthage error, skipped installing facebook-ios-sdk.framework binary 9.0.0 #1642

Closed aornano closed 3 years ago

aornano commented 3 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

What do you want to achieve?

Compiling facebook-ios-sdk latest release using carthage as explained to this repo.

Expected Results

What do you expect to happen?

Building successfully facebook-ios-sdk 9.0.0

Actual Results

What actually happened? Can you provide a stack trace?

ERROR:

Skipped installing facebook-ios-sdk.framework binary due to the error: "Incompatible Swift version - framework was built with 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) and the local version is 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28).

Steps to Reproduce

What are the steps necessary to reproduce this issue?

Due to famous Carthage problem with Xcode 12.x releases, I've prepared this script:

wcarthage.sh

#!/bin/sh -e
# 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.

CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig

echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $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 "$@"

So, on terminal I've launched the follow commands:

rm -rf ~/Library/Caches/org.carthage.CarthageKit
rm -rf Carthage/Build/iOS
rm -rf ~/Library/Developer/Xcode/DerivedData
sh wcarthage.sh bootstrap --platform iOS --cache-builds
joesus commented 3 years ago

Good catch, the issue is likely that the releases for Carthage are built using Xcode 11.4. If you'd like to update the Circle-CI configuration to use a later Xcode version I will gladly review the PR.

In the meantime if all you require is prebuilt frameworks, might I recommend using the XCFrameworks attached to the latest release. They do not require stripping any architectures. Thanks!

jawwad commented 3 years ago

Closing since @joesus updated to Xcode 12.4 in f9dd20ea6480f8e2b6acec01372fadf1cdabbc31.