Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Xcode 12 #30

Closed
mattyg opened this issue Oct 8, 2020 · 17 comments
Closed

Building on Xcode 12 #30

mattyg opened this issue Oct 8, 2020 · 17 comments
Labels
bug Something isn't working

Comments

@mattyg
Copy link
Contributor

mattyg commented Oct 8, 2020

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)
@mattyg mattyg added the bug Something isn't working label Oct 8, 2020
@youssmak
Copy link

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

@VTCoco
Copy link
Contributor

VTCoco commented Oct 13, 2020

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 (Carthage/Carthage#3019 (comment)) 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
Copy link
Contributor

VTCoco commented Oct 13, 2020

@mattyg
Copy link
Contributor Author

mattyg commented Oct 13, 2020

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
Copy link
Contributor

VTCoco commented Oct 14, 2020

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
Copy link
Contributor Author

mattyg commented Oct 14, 2020

@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
Copy link
Contributor

Tallyb commented Oct 21, 2020

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

@VTCoco
Copy link
Contributor

VTCoco commented Oct 21, 2020

Waiting for an official solution from Carthage maybe the current "best" way is to modify cordova script to use the custom carthage.sh (#30 (comment))?

@Tallyb
Copy link
Contributor

Tallyb commented Oct 21, 2020

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
Copy link
Contributor Author

mattyg commented Oct 23, 2020

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

@Tallyb
Copy link
Contributor

Tallyb commented Oct 26, 2020

@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
Copy link
Contributor Author

mattyg commented Oct 29, 2020

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!

@mattyg mattyg closed this as completed Oct 29, 2020
@Tallyb
Copy link
Contributor

Tallyb commented Oct 30, 2020

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

@VTCoco
Copy link
Contributor

VTCoco commented Nov 2, 2020

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
Copy link
Contributor

Tallyb commented Nov 4, 2020

@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
Copy link
Contributor

VTCoco commented Dec 9, 2020

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
Copy link
Contributor

Tallyb commented Dec 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants