Can't Compile kmn

Could someone please help me finish my Tablet keyboard. I’ve has a customized foreign language keyboard for years on my desktop and laptop. I’m trying now to make it compatible for my tablet. I follow all the instructions but cannot get past the kmn stage. When I try to compile it I get the message “Failure: ‘C:\Users\\OneDrive\Documents\Keyman Developer\Projects\\build\Tablet.kmn’ was not compiled successfully for Windows, macOS, Linux, Desktop devices.\par”. I don’t know what to do.

Can you put your keyboard folders and files somewhere (google drive folder, dropbox, etc) where they are accessible, then post the link here?

Hi!
Thanks for responding. Here is the link. I hope it is the right one.

https://drive.google.com/drive/folders/1IAvdsM-zwOaKpPM_cSaDdbNXETMh1Krd?usp=sharing

Thanks. You’ll need to grant read access to the folder, that is use “share” to grant “view” access to anyone with the link.

Here it is. I hope this is what you need.
https://drive.google.com/drive/folders/1IAvdsM-zwOaKpPM_cSaDdbNXETMh1Krd?usp=sharing

The immediate issue is that, on the Project Settings dialog (Project menu, Project Settings), you have the “Treat compiler hints and warnings as errors”. With that setting, when Keyman Developer warns about files (for example, “Tablet.kmn: Warning: 2000 The keyboard file Tablet.kmn does not follow the recommended filename conventions. The name should be all lower case, include only alphanumeric characters and underscore (_), and should not start with a digit.”), that warning is considered an error.

Unticking that option box, should allow the keyboard to compile, although at the point that I turned off that option, I had already used the “Details” tab to “Remove” the Embedded Javascript, Embedded CSS and Include Codes files (Tablet-code.js, Tablet.css, Tablet-codes.txt) which didn’t seem to be correct, so those may also have been causing an error. It doesn’t seem as though you need any of those for this keyboard, so I’d suggest removing them along with turning off the “Warnings as Errors” option.

There are a few places where you’ll want to correct your actual keyboard. Some of the unlabeled keys on the touch layout still produce a value. The “9” key produces “8”.

The recommended folder and filename conventions are designed to help keyboard designers in the creation process. If your keyboard is only for yourself, you can do whatever you like! If you intend to share it or submit it to the Keyman keyboard repository, you may need to make changes. “Tablet”, for example, is not a very descriptive name. There are a number of extraneous files.

Hopefully this will get you unstuck. Write again if you have further questions.

1 Like

Just for reference, the recommended structure would be (using a project name of “hebrew_phonetic”):

Folder “hebrew_phonetic” containing:

  • HISTORY.md
  • LICENSE.md
  • README.md
  • hebrew_phonetic.kpj
  • hebrew_phonetic.keyboard_info
  • Folder “source” containing:
    • hebrew_phonetic.kmn
    • hebrew_phonetic.kvks
    • hebrew_phonetic.kps
    • hebrew_phonetic.keyman-touch-layout
    • hebrew_phonetic.ico

For the Keyman keyboards repository, we also want (in specific locations):

  • readme.htm = brief introduction displayed when desktop keyboard installed
  • welcome.htm = help information for the keyboard (part of the keyboard package)
  • hebrew_phonetic.php = the same help information in a form usable by the Keyman site

The goal is to make it as easy as possible for people to use the keyboard.

I worked hard to fix the build and source page so that all the capitals should be lower case. It was hard because every time I corrected a file name, as soon as I clicked outside the field it reverted to a capital.I don’t know how or why, but finallyI did it. I’m afraid that I inadvertently deleted one file and don’t know what it was.
I don’t know what you mean by: " Unticking that option box, ---- (How does one untick the option box, and what is the option box to begin with?), ---- should allow the keyboard to compile, although at the point that I turned off that option, I had already used the “Details” tab to “Remove” the Embedded Javascript, Embedded CSS and Include Codes files (Tablet-code.js, Tablet.css, Tablet-codes.txt) which didn’t seem to be correct, so those may also have been causing an error. It doesn’t seem as though you need any of those for this keyboard, so I’d suggest removing them along with turning off the “Warnings as Errors” option." How do I remove the “Warnings as Errors”option? Furthermore, another SIL correspondent says that the .js files are quite necessary for a tablet or phone keyboard.
Frankly, I’m getting very depressed about the whole thing. Perhaps I should start it all over from scratch.

.You say you removed the embedded Javascript

In Keyman Developer, from the Project menu, select Project Settings. In the dialog that appears:
image
Click on the box to the left of “Treat compiler hints and warnings as errors” to clear the check mark. If the box is empty, the option is turned off.

1 Like

phonetic_hebrew_asdf.zip (110.0 KB)

This zip file contains a working keyboard based on your files. I used the name “phonetic_hebrew_asdf” throughout. (I did not include the online help file, which is usually based on the welcome.htm file.) I removed a lot of duplicate files and some unreferenced ones. My goal was to make a simple, working keyboard.

When you compile the keyboard (Select “Keyboards” at the bottom, then the .kmn file, then “Build” on the left, then “Compile Keyboard” button), the .kmx, .kvk and .js files will be created in the “build” folder. When you build the package for distribution (Select “Packaging” at the bottom, then the .kps file, then “Build” on the left, then “Compile Package” button), the .kmp file will be created in the “build” folder. The .kmp file is the keyboard package that can be distributed. It includes the .kmx file that provides the computer keyboard, the .kvk file that shows the computer keyboard layout on screen, and the .js file that provides the touch keyboard functionality.

So if you unzip the phonetic_hebrew_asdf.zip file, double-click on the .kpj file to launch Keyman Developer, then follow the steps in the previous paragraph, you should be able to build the keyboard and package it. You can then experiment with further modifications.

If you want to include fonts or images, you’ll need to make sure that they are licensed in such a way that you are free to include them in your package.

I did as you said and the kmn compiled successfully.
Then I went to Packaging as you said and clicked the kpj, only to receive a notice that it does not exist and a choice to do it now or not. Once, I chose to do it now but instead of returning me to it, I received a blank screen with no entries on it. Fortunately, it was not lost and after some attempts was able to retrieve it. I didn’t want to try again for fear of losing it completely, but I could not build it into a kmp.
Here are the notices I received:

image.png

Hmm. Here’s the process I used, after downloading and extracting the .zip file.
Double-click on the .kpj file to bring up Keyman Developer, Click on “Keyboards” (1) at the bottom, then the .kmn name (2).

image

Click on “Build” on the left (3), then “Compile Keyboard” (4). Note that you can test the keyboard in your browser using the “Test keyboard on web” and “Open in browser” buttons.

Click on the .kpj filename (5) to bring up the Packaging option, then on “Packaging” (6) at the bottom, then on the .kps filename (7).

Click on “Build” on the left (8), then “Compile Package” (9)

The result should be a successfully compiled package:

I followed your instructions and finally was successful until compiling of Packaging, Here is the notice:

I tried typing on the web as you suggested and it worked. The only thing left is how to install it on my tablet. I’ve done all this work on my laptop. I clicked Distribution and then the file name and it showed me an unfinished

keyboard without any instructions how to install even that, let alone the complete one.

David,

As I wrote in my previous message, it finally worked until the Packaging stage and I received this notice:

Somehow, I don;t know how, it got installed on my laptop that I used to develop it.

What do I do now to transfer the file to my Tablet and install it? When I open the Distribution box I get this link :
image.png

I finally did it and got a kmp. I even made a new and better board from scratch and also got a kmp and

installed it into my laptop on which I made it. The only problem now is this: I sent it over to my tablet as
an email attachment and downloaded it. But the tablet will not install it. When I click on the downloaded

file either nothing happens or I get a notice there is “no app to open this file”. Also, after I got the kmp I

was not able to move it into the Distribution phase,although I don’t know if that is necessary.

image.png

Have you installed Keyman on your tablet? Each platform (Windows, Mac, Linux, Android, iOS, etc has its own “engine” that enables the keyboard package (.kmp file) to work on that platform. Once Keyman is installed on the tablet, it should be able to read the .kmp file.

To elaborate.
If you have an Android tablet, install “Keyman for Android” from the Play Store
If you have an iPad tablet, install “Keyman for iPhone and iPad” from the App Store.

Then launch Keyman and install your custom keyboard kmp following the corresponding guide:

https://help.keyman.com/products/android/current-version/basic/installing-custom-packages

https://help.keyman.com/products/iphone-and-ipad/current-version/basic/installing-custom-keyboards-dictionaries

My device is Android. In the Play store there is only one Keyman app that I installed.It makes no distinction between Android and iPhone,
I think all of it is instructions but no simple program to download. I downloaded my kmp file to the device’s download folder, and followed
the instructions to select the file in the download folder, then to click "Install From Local File"on the Keyman screen, but nothing happened.

Hmm, that should have opened your Android device’s file browser where you can navigate to the .kmp file and select it to install.

On some Android devices, you may need to check that Keyman has permissions to access external SD storage. The steps may vary, but something like:

https://help.keyman.com/products/android/16.0/troubleshooting/grant-storage-permission

I followed the instructions and was automatically navigated to the Downloads folder. I selected the kmp file but nothing happened.
I did not receive any popup about permissions to access external SD storage. I don’t even know what that is.The link you refer me to

does not even show an accurate illustration of my Keyman homescreen, since mine shows nothing under “Settings” about “app permissions” or

“storage”.
I ran a search on the Keyman site for “install custom keyboard” and received this link:

[help.keyman.com › guides › distribute › install-kmp-android](http://help.keyman.com › guides › distribute › install-kmp-android)
It did not help since Step 1in it seems to be showing the screen of another version than mine.I skipped anyway to Step 2 and did it.
Step 3 again was about “Storage” and I didn’t know what to do.