Custom Keyboards not loading in KMEA

Both of my KM10 Keyman keyboards fail to load using KMEA version .405’s .aar file in both my custom app and kmsample2, but the included Tamil works.

I compiled, tested web/chrome debugged, and copied my build .js files to the cloud folder and added the following to SystemKeyboard.java after the Tamil one:

// Add a custom keyboard
HashMap<String, String> kbInfoA = new HashMap<String, String>();
kbInfoA.put(KMManager.KMKey_PackageID, “cloud”);
kbInfoA.put(KMManager.KMKey_KeyboardID, “cameroon_azerty”);
kbInfoA.put(KMManager.KMKey_LanguageID, “ewo”);
kbInfoA.put(KMManager.KMKey_KeyboardName, “Cameroon AZERTY”);
kbInfoA.put(KMManager.KMKey_LanguageName, “Multilingual”);
kbInfoA.put(KMManager.KMKey_KeyboardVersion, “4.0”);
kbInfoA.put(KMManager.KMKey_Font, “andikaa.ttf”);

KMManager.addKeyboard(this, kbInfoA);

// Add a custom keyboard
HashMap<String, String> kbInfoQ = new HashMap<String, String>();
kbInfoQ.put(KMManager.KMKey_PackageID, “cloud”);
kbInfoQ.put(KMManager.KMKey_KeyboardID, “cameroon_qwerty”);
kbInfoQ.put(KMManager.KMKey_LanguageID, “ewo”);
kbInfoQ.put(KMManager.KMKey_KeyboardName, “Cameroon QWERTY”);
kbInfoQ.put(KMManager.KMKey_LanguageName, “Multilingual”);
kbInfoQ.put(KMManager.KMKey_KeyboardVersion, “4.0”);
kbInfoQ.put(KMManager.KMKey_Font, “andikaa.ttf”);
//kbInfo.put(KMManager.KMKey_Font, KMManager.KMDefault_KeyboardFont); // Use the default font
KMManager.addKeyboard(this, kbInfoQ);

Each Time I choose one of my keyboards, I get the following onscreen popup:

Cannot set cloud::cameroon_qwerty for ewo language. Loading default keyboard.

and
the debugger gives:

07-17 01:11:25.170 3635-3635/com.keyman.kmsample2 D/KMEA: Keyman JS Log: Line 94, file:///data/user/0/com.keyman.kmsample2/app_data/keyman.js:No keyboard stubs exist - cannot initialize keyboard!

Keyboard 1:
https://github.com/silcam/Cameroon-Keyboard/tree/master/src/km/cameroon_azerty/source

Keyboard 2:
https://github.com/silcam/Cameroon-Keyboard/tree/master/src/km/cameroon_qwerty/source

Both of these keyboards work as expected in Chrome emulators, and throw no compile errors, and I can’t debug Keyman.js under Android as it is not part of the project. What about these keyboards does KMEA hate so much that KMW is OK with? I don’t have enough information to produce a minimal repro.

Tested in emulated Android 8.1.
keymandeveloper-10.0.1113.0.exe
keyman-engine.aar from 10.0.405

On a side-note, it says my KMEngine version is 2.4.3. I was expecting to see 10.0.405.

Hi Matthew

In the source to cameroon_azerty, you have the keyboard version 5.3 so after you build the keyboard:

  1. Rename it to “cameroon_azerty-5.3.js” and move it to the cloud folder
  2. Modify your SystemKeyboard.java
    HashMap<String, String> kbInfo = new HashMap<String, String>();
    kbInfo.put(KMManager.KMKey_PackageID, "cloud");
    kbInfo.put(KMManager.KMKey_KeyboardID, "cameroon_azerty");
    kbInfo.put(KMManager.KMKey_LanguageID, "ewo");
    kbInfo.put(KMManager.KMKey_KeyboardName, "Cameroon AZERTY");
    kbInfo.put(KMManager.KMKey_LanguageName, "Multilingual");
    kbInfo.put(KMManager.KMKey_KeyboardVersion, "5.3");
    kbInfo.put(KMManager.KMKey_Font, "ANDIKAAFR-R.TTF");
    //kbInfo.put(KMManager.KMKey_Font, KMManager.KMDefault_KeyboardFont); // Use the default font
    KMManager.addKeyboard(this, kbInfo);

I was able use KMSample2 and got this keyboard

image

There’s still some font issue I haven’t figured out. I’ve had more success creating keyboard packages which define the OSK font and installing the keyboard packages in the Keyman app…

ah, I think I needed to install ANDIKAAFR-R.ttf first

image

Thank you, THANK YOU!
Making the version numbers match was key. It didn’t matter in previous versions of KMEA, so I hadn’t been paying attention.

Glad the keyboard is working for you now. Where were you seeing the KMEngine version 2.4.3?

@darcy, could you make sure this information is clear in the documentation – and we should make this renaming unnecessary in future versions.

could you make sure this information is clear in the documentation

The following guides have been updated to clarify renaming the keyboards with the keyboard version:
https://help.keyman.com/DEVELOPER/engine/android/10.0/guides/in-app/
https://help.keyman.com/DEVELOPER/engine/android/10.0/guides/system-keyboard/

– and we should make this renaming unnecessary in future versions.

This will be tracked in https://github.com/keymanapp/keyman/issues/1076