iink SDK on Device

Answered

当使用中文/英文分开识别的两个EditorView时,偶现下列错误

 

04-01 21:30:42.346 E/SmartGuideView( 3587): Failed to edit block "MainBlock": INVALID_CERTIFICATE: error: AddResource zh_CN/zh_CN-ak-cur.res failed

04-01 21:30:42.346 E/SmartGuideView( 3587): error: failed to read configuration script


04-01 21:30:42.346 E/SmartGuideView( 3587): script exits with 2 errors


04-01 21:30:42.346 E/MyScriptPresenter( 3587): onError s=MainBlock s1=INVALID_CERTIFICATE: error: AddResource zh_CN/zh_CN-ak-cur.res failed


04-01 21:30:42.346 E/MyScriptPresenter( 3587): error: failed to read configuration script


04-01 21:30:42.346 E/MyScriptPresenter( 3587): script exits with 2 errors




Best Answer

Dear Customer,


I am sorry, but I do not understand what your doing, nor what is happening on your side.


First, which account are you using for your application? if using your own email, as of today (April 10, 2020), in your console, I still many errors related to the certificate:

Mismatch between certificate and application: com.**.***tch != com.**.***stu


=>If this is your application, please create a new certificate, and update your application with it. I already provided with the link how to build a new certificate earlier in this topic.


If you are using another account, please provide with the email of the latter, I will then check the console and see if there are any error messages.


Also, I mentionned you set a delay in between each editor creation (the English and Chinese one) ; did you try this?


need to release app before you know if there's any feedback.

>>Please answer the above questions, so that we can help you further.


Best regards,


Olivier


Dear Customer,


thank you for contacting us.


First, can you confirm you deployed the Chinese language package in the assets of your project? If not, you shall proceed as indicated in our documentation:

-https://developer.myscript.com/docs/interactive-ink/1.3/android/fundamentals/interactive-ink-runtime/#language-recognition-configuration


And on our forum: https://developer-support.myscript.com/support/discussions/topics/16000026806


If the Chinese language has been properly deployed, can you please check your device has an internet connection? Indeed, after first-install, your application shall connect to our license server in the coming 30 days, and I did not see any activation in your dashboard, so that may be another option.


Best regards,


Olivier

image

Bundle-Version: 1.0
Bundle-Name: zh_CN
Configuration-Script:
AddResDir ../resources/

Name: text
Type: Text
Configuration-Script:
AddResource zh_CN/zh_CN-ak-cur.res
AddResource zh_CN/zh_CN-lk-text.res
AddResource mul/mul-lk-english_secondary_2.res
SetHalfWidthFullWidthScheme AUTO
EnableAlienCharacters
SetTextListSize 1
SetWordListSize 5
SetCharListSize 1

And this is used account ,can see dashboard

 ***

Dear Customer,


thank you for the update and account used.


In your dashboard, you currently have the "Mismatch between certificate and application:" error message.


The reason is that your certificate has the ***.***.***dtch identifier, and your application name is ***.***.***dstu.


You then have 2 possibilities, either you rename your application or re-create a certifcate with the proper application name: https://developer.myscript.com/support/account/on-device-license-management/


Best regards,


Olivier

But the error message is from  `**.**.ime`.And  english recognition is correct.only chinese recognition may have error.

 

Dear Customer,


currently, do you create the Chinese editor just after the english one? If so, can you please try to add a small delay in between both editors creation?


Best regards,


Olivier

This is english recognition code 

        Configuration conf = scriptEngine.getConfiguration();
        String confDir = "zip://" + context.getPackageCodePath() + "!/assets/conf";
        conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
        conf.setString("lang", "en_US");
        conf.setBoolean("gesture.enable", false);
        conf.setBoolean("export.jiix.strokes", false);
        conf.setBoolean("export.jiix.bounding-box", false);
        conf.setBoolean("export.jiix.glyphs", false);
        conf.setBoolean("export.jiix.primitives", false);
        conf.setBoolean("export.jiix.chars", false);
        String tempDir = context.getFilesDir().getPath() + File.separator + "tmp";
        conf.setString("content-package.temp-folder", tempDir);

 And this is chinese recoginition code

 

        Configuration conf = scriptEngine.getConfiguration();
        String confDir = "zip://" + context.getPackageCodePath() + "!/assets/conf";
        conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
        conf.setString("lang", "zh_CN");
        conf.setBoolean("gesture.enable", false);
        conf.setBoolean("export.jiix.strokes", false);
        conf.setBoolean("export.jiix.bounding-box", false);
        conf.setBoolean("export.jiix.glyphs", false);
        conf.setBoolean("export.jiix.primitives", false);
        conf.setBoolean("export.jiix.chars", false);
        String tempDir = context.getFilesDir().getPath() + File.separator + "tmp";
        conf.setString("content-package.temp-folder", tempDir);

maybe chinese first or english first.


when change the editor may add a small delay before this code ?

And they are in different class

Dear Customer,


can you please try to start the second editor with a delay (e.g. 1 second): https://stackoverflow.com/questions/15874117/how-to-set-delay-in-android


This may help.


If it doesn't work, please provide us with a project that allows to reproduce.


Best regards,


Olivier

Every time I switch recognition types, I repeat calling the following methods

 

JAVA

        Configuration conf = editor.getConfiguration();
        String[] paths = conf.getStringArray("configuration-manager.search-path");
        if (paths == null || paths.length == 0 || !"zh_CN".equals(conf.getString("lang"))) {
            String confDir = "zip://" + context.getPackageCodePath() + "!/assets/conf";
            conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
            conf.setString("lang", "zh_CN");//中文语言包
            conf.setBoolean("gesture.enable", false);
            conf.setBoolean("export.jiix.strokes", false);
            conf.setBoolean("export.jiix.bounding-box", false);
            conf.setBoolean("export.jiix.glyphs", false);
            conf.setBoolean("export.jiix.primitives", false);
            conf.setBoolean("export.jiix.chars", false);
            String tempDir = context.getFilesDir().getPath() + File.separator + "tmp";
            conf.setString("content-package.temp-folder", tempDir);
        }


So I did the optimization.Could there be a problem?   May there be a problem with frequent calls?

Dear Customer,


Did you add a timer in between both editors creation?


Also, is it possible to gave again the account email on which the certificates were created? This will allow to check your console.


Best regards,


Olivier

Initialize only once, just switch behind

 

That's the account number.

Dear Customer,


currently, you did not answer the question regarding the delay in between both editors creation. Did you try? Is it working?


Also, I cannot see the email of the account used to create the certificate.


Best regards,


Olivier

This problem is accidental.  need to release app before you know if there's any feedback.

I just wanted to ask if it was the right way.