voxeet / voxeet-uxkit-cordova

Dolby.io UXKit for Cordova
Other
1 stars 14 forks source link

Building on Xcode 12 #30

Closed mattyg closed 3 years ago

mattyg commented 3 years ago

I saw that voxeet-uxkit-ios was just updated 1.3.6 to support building with Carthage on Xcode 12. I forked this plugin to use the updated voxeet-uxkit-ios, but I'm still unable to build it.

After adding the plugin to cordova, and it failing, I run the following (where carthage.sh is the script noted in this comment

$ carthage.sh update --platform ios --project-directory /path/to/app/plugins/cordova-plugin-voxeet/src/ios
*** Downloading binary-only framework VoxeetSDK at "https://raw.githubusercontent.com/voxeet/voxeet-sdk-ios/master/VoxeetSDK.json"
*** Fetching voxeet-uxkit-ios
*** Fetching SDWebImage
*** Checking out SDWebImage at "5.9.2"
*** Checking out voxeet-uxkit-ios at "1.3.6"
*** xcodebuild output can be found in /var/folders/th/kpczdd1n4blgjjmt36z20qtc0000gn/T/carthage-xcodebuild.EujLK8.log
*** Valid cache found for SDWebImage, skipping build
*** Valid cache found for VoxeetSDK, skipping build
*** No cache found for voxeet-uxkit-ios, building with all downstream dependencies
*** Building scheme "VoxeetUXKit" in VoxeetUXKit.xcodeproj
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -project /path/to/app/plugins/cordova-plugin-voxeet/src/ios/Carthage/Checkouts/voxeet-uxkit-ios/VoxeetUXKit.xcodeproj -scheme VoxeetUXKit -configuration Release -derivedDataPath /Users/matt/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0.1_12A7300/voxeet-uxkit-ios/1.3.6 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/th/kpczdd1n4blgjjmt36z20qtc0000gn/T/voxeet-uxkit-ios SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /path/to/app/plugins/cordova-plugin-voxeet/src/ios/Carthage/Checkouts/voxeet-uxkit-ios)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/th/kpczdd1n4blgjjmt36z20qtc0000gn/T/carthage-xcodebuild.EujLK8.log

The xcodebuild log ends with the following:

** ARCHIVE FAILED **

The following build commands failed:
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
youssmak commented 3 years ago

@VTCoco could you please upgrade voxeet-uxkit-cordova project for compatibility with XCode 12 ?

VTCoco commented 3 years ago

Hello @mattyg, you were on a good track but you forgot to also bump the VoxeetSDK version. I will publish a new update that bump those frameworks and @youssmak you will need to create a carthage.sh script like the one mentions above (https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323) because Carthage doesn't officially supports Xcode 12.

My carthage.sh script looks like:

#!/usr/bin/env bash

# https://github.com/Carthage/Carthage/issues/3019

# 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 "$@"
VTCoco commented 3 years ago

https://github.com/voxeet/voxeet-uxkit-cordova/releases/tag/v1.3.33

mattyg commented 3 years ago

Thanks @VTCoco, but the build is still failing with the same error on 1.3.33. Have you been able to successfully install the plugin in an example cordova app?

VTCoco commented 3 years ago

With these steps I got my sample running:

#  Clean voxeet plugin
cordova plugin remove cordova-plugin-voxeet

# Add voxeet plugin from npm
cordova plugin add cordova-plugin-voxeet

The last step should fail because it can't use carthage with Xcode 12 on SDWebImageMapKit or VoxeetUXKit:

...
Error: Command failed: carthage update --platform ios --project-directory /Users/clarr/Projects/test/cordova/hello2/plugins/cordova-plugin-voxeet/src/ios
Build Failed
    Task failed with exit code 1:
...

Then launch the local carthage script:

./carthage.sh update --platform ios --project-directory /Users/username/Projects/cordova/plugins/cordova-plugin-voxeet/src/ios

*** Downloading binary-only framework VoxeetSDK at "https://raw.githubusercontent.com/voxeet/voxeet-sdk-ios/master/VoxeetSDK.json"
*** Fetching voxeet-uxkit-ios
*** Fetching SDWebImage
*** Checking out SDWebImage at "5.9.3"
*** Checking out voxeet-uxkit-ios at "1.3.6"
*** xcodebuild output can be found in /var/folders/kf/_9zzfzb560l0m3lv5y_1kvq09s97zx/T/carthage-xcodebuild.0SWyCh.log
*** Downloading binary-only framework VoxeetSDK at "https://raw.githubusercontent.com/voxeet/voxeet-sdk-ios/master/VoxeetSDK.json"
*** Building scheme "SDWebImageMapKit" in SDWebImage.xcodeproj
*** Building scheme "SDWebImage" in SDWebImage.xcodeproj
*** Building scheme "VoxeetUXKit" in VoxeetUXKit.xcodeproj
mattyg commented 3 years ago

@VTCoco Huh, I'm not sure what's different about my system. I tried on Xcode 12.0.1 and downgraded to 12.0 and am still getting the same result.

I'm following the same steps, and the ./carthage.sh command output still ends with:

*** Building scheme "VoxeetUXKit" in VoxeetUXKit.xcodeproj
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -project /Users/matt/Documents/voxeet-cordova-example/src-cordova/plugins/cordova-plugin-voxeet/src/ios/Carthage/Checkouts/voxeet-uxkit-ios/VoxeetUXKit.xcodeproj -scheme VoxeetUXKit -configuration Release -derivedDataPath /Users/matt/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/voxeet-uxkit-ios/1.3.6 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/th/kpczdd1n4blgjjmt36z20qtc0000gn/T/voxeet-uxkit-ios SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/matt/Documents/voxeet-cordova-example/src-cordova/plugins/cordova-plugin-voxeet/src/ios/Carthage/Checkouts/voxeet-uxkit-ios)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/th/kpczdd1n4blgjjmt36z20qtc0000gn/T/carthage-xcodebuild.dxQYCp.log

And the xcodebuild log still ends with:

** ARCHIVE FAILED **

The following build commands failed:
    CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
Tallyb commented 3 years ago

How is that suppose to run in a CI? The plugin script is still failing

VTCoco commented 3 years ago

Waiting for an official solution from Carthage maybe the current "best" way is to modify cordova script to use the custom carthage.sh (https://github.com/voxeet/voxeet-uxkit-cordova/issues/30#issuecomment-707554171)?

Tallyb commented 3 years ago

I think this is a valid solution. Add the carthage.sh to the repo and call it. Or maybe you can just add a xxconfig.tmp and use it for configuration.

mattyg commented 3 years ago

@Tallyb Is it actually building for you with the carthage.sh script?

Tallyb commented 3 years ago

@mattyg - with some tweaks. Unfortunately, it does not seem to work properly. @VTCoco - I think embedding properly built frameworks in the repo, is the one solution that can save all this trouble. We have been spending days over this.

mattyg commented 3 years ago

It's building and working properly now with the new release 1.3.35 running the 3.x sdk.

Thanks so much for your help!

Tallyb commented 3 years ago

Well - you would except upgrading the sdk to a major version would at least be a minor version for this plugin, no?

VTCoco commented 3 years ago

Hello, yes we published the v1.3.35 with your advices to integrate the Carthage script into the Cordova build, thank you for your help.

Tallyb commented 3 years ago

@VTCoco - I think it will work best if you simply embed the built framework in the code and not rely on local carthage. That can surely remove many problems of the build, and any new sdk requires a new release whatsoever.

VTCoco commented 3 years ago

Do you want our .framework directly been published into github? (this is a bad idea)

However if you want to get our .framework from somewhere else than Carthage (which doesn't officially support Xcode 12 for now as a reminder...) you can grab them from our S3 links available here: https://github.com/voxeet/voxeet-sdk-ios/blob/master/VoxeetSDK.json

Tallyb commented 3 years ago

well, wikitude cordova plugins, for instance, place the FW inside the repo. Anyway, having those links is useful. thank you.