Closed joseph-francis closed 7 years ago
You're ahead of the curve, @joseph-francis! :)
We provide precompiled binaries with each GitHub release of the Swift SDK. That saves time for our users, since Carthage will just download the binaries instead of building each one. In your case, though, the binaries (which were built with Swift 3.1) are incompatible with Swift 4.0.
To skip the precompiled binaries and build them on your machine instead, run:
carthage update --platform iOS --no-use-binaries
We haven't tried to build the SDK with Swift 4.0 yet. Hopefully it works for you. If not, feel free to open an issue and we'll try to fix it as soon as we can!
I tried doing that, but it still shows me the error. Should I wait till you guys build the SDK with Swift 4.0? If so, what should I do when you guys finish building it? Also, is there anything else I could try? Thank you for your help. JF
Hi @joseph-francis, I just got my Watson set up working by adding files manually. By adding manually I mean you can add the repository as a git submodule, drag the .xcodeproj file into your Xcode project, and then add the framework you want into the embedded binaries section. You may have to remove your Carthage references, but it's working for me :) More on this style of adding dependencies here: https://www.raywenderlich.com/155150/dependency-management-using-git-submodules
Thanks for the recommendation, @MatthewWaller!
Here's another approach, too. By default, running Xcode 9 does not change the version of the command-line tools that are being used. Since you still ran into that issue when using the --no-use-binaries
option, @joseph-francis, your command line tools may still be set to Xcode 8.
To change them, open the Xcode Preferences and select the Locations tab. Then from the drop-down next to "Command Line Tools" choose "Xcode 9.0".
I downloaded the Xcode 9 Beta 2, set my command line tools, and tried carthage update --platform iOS --no-use-binaries
. That seemed to successfully build most of the service SDKs with Xcode 9 / Swift 3.2 (which is compatible in a Swift 4.0 project).
However, there was an error with the TextToSpeech framework--which seems to be the framework you'd like to use. Xcode 9 has changed some of the behavior around C imports, which we use for the Opus library. I opened #641 to track that particular issue.
Hopefully that helps you build the other service frameworks. We'll try to fix that issue with Text to Speech soon.
@glennrfisher @MatthewWaller Thanks for replying to my issue. I tried doing both ways, but it didn't work. In location->Command Line Tool, it was Xcode 9.
Sorry to hear that, @joseph-francis. It worked okay on my machine, so there might be something different about our environments. Here are a few ideas that come to mind:
When changing the Xcode command line tools, you may need to restart Xcode and the Terminal in order for that change to take effect.
You may need to clean the project to reset any build errors/warnings. You can clean the project by selecting Product -> Clean. And it can also be helpful to clean the build folder, which you can do by selecting the Product menu, holding option, then selecting Clean Build Folder.
Hope that helps! Curious to hear about the results.
Any luck, @joseph-francis?
@glennrfisher Currently I downgraded Swift, Xcode and iOS version. It should be fine when swift 4 is officially released. Thank you for helping me and sorry for late reply.
Oh, no worries! Just wanted to make sure that things were working for you. Glad it's building, although I wish we didn't have to put you through the trouble of downgrading. Sorry for that!
Thanks glennrfisher Your suggestion works for me. We provide precompiled binaries with each GitHub release of the Swift SDK. That saves time for our users, since Carthage will just download the binaries instead of building each one. In your case, though, the binaries (which were built with Swift 3.1) are incompatible with Swift 4.0.
To skip the precompiled binaries and build them on your machine instead, run: carthage update --platform iOS --no-use-binaries
We haven't tried to build the SDK with Swift 4.0 yet. Hopefully it works for you. If not, feel free to open an issue and we'll try to fix it as soon as we can!
if I use cocopods how to solve this problem?
@gaoml0904 The SDK doesn't currently support CocoaPods (planning to add this soon). To install via Carthage, please check the readme or quick-start guide.
I updated my swift version to 4.0. After that, I'm seeing this error. "Module compiled with Swift 3.1 cannot be imported in Swift 4.0: /Users/joseph/Desktop/News/Carthage/Build/iOS/TextToSpeechV1.framework.." I'm not sure what's going on.