Hi! I am planning on integrating a keyman keyboard into my app, but first I wanted to try using the sample project in KMSample1 to get a handle on how it works, but the xcode build fails when I try. There is an issue with the Keyman Engine dependencies. I have tried adding a Carthage cartfile, but I cannot find all the necessary information to include for all the dependencies. I am not sure if a build step is necessary first, but when I try to run the included build.sh script, it fails because the file “resources/build/build-utils.sh” (from line 13 of the build_common.sh) cannot be found.
I am not sure what to try next. I assume I am missing something simple, since this is just supposed to be a sample project. Any advice?
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/ObjcExceptionBridging.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/Reachability.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/ZIPFoundation.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/Sentry.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/DeviceKit.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/samples/KMSample1/KeymanEngine.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/XCGLogger.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/Reachability.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/ObjcExceptionBridging.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/ZIPFoundation.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/DeviceKit.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/Sentry.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/Carthage/Build/XCGLogger.xcframework'. (in target 'KMSample1' from project 'KMSample1')
error: There is no XCFramework found at '/Users/brodieheginbotham/Downloads/keyman-engine-ios-16.0.144/samples/KMSample1/KeymanEngine.xcframework'. (in target 'KMSample1' from project 'KMSample1')
Welcome @Brodieheg, thank you for reporting this issue. You should be able to simply open the KMSample1 project in Xcode and build it, but I was able to reproduce the issue with a clean copy of the Keyman 16 code myself. I’ll need a little more time to investigate and will update you as soon as I have something.
Thanks Shawn! Let me know what you find. I am newer to iOS development and so I may be missing things. I actually cannot get any version of the Keyman engine to build. I have tried running the build.sh script from the terminal as well and it fails also.
Do we need to add a cartfile and run carthage on it in order to add the dependency frameworks into our own projects? I guess I’m just not sure of the necessary steps to bring a Keyman kmp keyboard into my own project.
Thanks so much, Shawn! I am getting this error when I run the build script, in your step 3:
…/build_common.sh: line 13: /Users/brodieheginbotham/Downloads/KeymanEngineClone/keyman-engine-ios-16.0.145/samples/…/…/resources/build/build-utils.sh: No such file or directory
Hey Marc! I think you may have nailed it. I am downloading the latest stable repo from here: https://downloads.keyman.com/ios/stable/
It doesn’t have any resources folder. Is that not where the correct repo should be downloaded from?
Apparently the -g option on declare was introduced on a later version of the bash shell than what is standard on mac. But even when I upgraded to the most recent bash shell, the build still fails. The -no-codesign parameter is said to be invalid. When I run ./build.sh without it, the output is:
[ios/samples/KMSample1] build.sh parameters: <>
[ios/samples/KMSample1] ## build starting...
[ios/engine] dependency build, started by ios/samples/KMSample1
[ios/engine] build.sh parameters: <configure build --deps --builder-dep-parent ios/samples/KMSample1>
[ios/engine] ## configure starting...
[ios/engine] Skipping dependency web/src/app/webview for configure
[ios/engine] Skipping dependency common/web/sentry-manager for configure
Downloading sil_euro_latin.kmp from downloads.keyman.com
/Users/brodieheginbotham/Downloads/code/keyman/resources/build/build-download-resources.sh: line 34: jq: command not found
[ios/engine] Downloading /Users/brodieheginbotham/Downloads/code/keyman/ios/engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/sil_euro_latin.kmp failed with error 3
[ios/engine] ## configure failed
[ios/samples/KMSample1] ## Dependency failed with exit code 1
[ios/samples/KMSample1] ## build failed
Output is the same if I run ./build.sh --debug which is listed as a valid parameter to skip codesigning.
Ultimately, I’m looking to create an in-app keyboard for Greek and Hebrew in my app, so that users don’t have to download a keyboard themselves (a lot of our users are having trouble downloading their own greek/hebrew keyboard). Is the Keyman engine able to do that? I’m worried with all these build fails on the sample project, that I may not be able to build it for use in my app.
Shawn is looking into the build issues for the sample project.
From my perspective, you should not need to clone the whole Keyman repo and setup the Keyman build environment in order to use the Keyman Engine framework! You should be able to take the framework file and plug it into the sample project and it should “just build” in XCode (without needing to use build.sh at all). That’s the intent behind sharing the sample project as a zip, but obviously things are broken. I am hopeful we can solve those problems soon – they are just around configuration and not really in the code itself.
@Brodieheg – just wanted to update you on this. I’ve identified the cause, and we need to change how we are building the zip file. I will be working on a fix for that early next week and will let you know when it’s ready.
@Brodieheg, we have a new version of Keyman 16 that builds the zip file correctly. Please try building KMSample1 again with version 16.0.147. I am now able to download and open the project in Xcode and run the sample as described in the instructions here: Guide: build an in-app keyboard
Thanks for reporting the issue to us so that we could get this working properly!
Shawn
Hey Shawn! Thanks for sticking with me! The app still doesn’t build. It looks like there is a problem with Reachability? If it builds on your machine, maybe there is some kind of configuration step I’m missing that isn’t in the guide?
That is surprising that it would not be able to find the Reachability framework when it is copied directly into the Frameworks folder. If you can give me the detailed error, it might help to understand why it is failing.
In Xcode, please go to View → Navigators → Reports and select the failed build from the list. Then select the build error for the failed build and copy the full error text and paste it here or attach it as a text file.
I did not need to any additional configuration to build successfully. I just opened KMSample1.xcodeproj from keyman-engine-ios-16.0.147.zip and built it.
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:73:24: error: ‘Reachability’ is not a member type of class ‘Reachability.Reachability’
extension Reachability.Reachability {
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:93:24: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
extension Reachability.Reachability.NetworkStatus : Swift.Equatable {}
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:95:24: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
extension Reachability.Reachability.NetworkStatus : Swift.Hashable {}
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:96:24: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
extension Reachability.Reachability.Connection : Swift.Equatable {}
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:97:24: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
extension Reachability.Reachability.Connection : Swift.Hashable {}
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:24:53: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public typealias NetworkReachable = (Reachability.Reachability) -> ()
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:25:55: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public typealias NetworkUnreachable = (Reachability.Reachability) -> ()
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:32:44: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public static func == (a: Reachability.Reachability.NetworkStatus, b: Reachability.Reachability.NetworkStatus) -> Swift.Bool
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:32:88: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public static func == (a: Reachability.Reachability.NetworkStatus, b: Reachability.Reachability.NetworkStatus) -> Swift.Bool
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:45:44: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public static func == (a: Reachability.Reachability.Connection, b: Reachability.Reachability.Connection) -> Swift.Bool
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:45:85: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public static func == (a: Reachability.Reachability.Connection, b: Reachability.Reachability.Connection) -> Swift.Bool
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:51:42: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public var whenReachable: Reachability.Reachability.NetworkReachable?
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:52:44: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public var whenUnreachable: Reachability.Reachability.NetworkUnreachable?
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:62:54: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public var currentReachabilityStatus: Reachability.Reachability.Connection {
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:65:39: error: 'Reachability' is not a member type of class 'Reachability.Reachability'
public var connection: Reachability.Reachability.Connection {
~~~~~~~~~~~~ ^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/Reachability.framework/Modules/Reachability.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:23:14: note: 'Reachability' declared here
public class Reachability {
^
/Users/bheginbotham/Library/Developer/Xcode/DerivedData/KMSample1-dblzuqvvjrlcucbspjvgrvqijhdh/Build/Products/Debug-iphonesimulator/KeymanEngine.framework/Modules/KeymanEngine.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:10:8: error: failed to build module 'Reachability'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)'). Please select a toolchain which matches the SDK.
import Reachability
^
/Users/bheginbotham/Downloads/keyman-engine-ios-16.0.147/samples/KMSample1/KMSample1/ViewController.swift:8:8: error: failed to build module 'KeymanEngine'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)'). Please select a toolchain which matches the SDK.
import KeymanEngine