Application Tool Kit

Android Studio throwing error after migrating from Eclipse.

I have a project in Eclipse in which i am using MathWidget and its working fine. The same project I have imported to Android Studio and ran it. It did'nt give any build error and it installed the app on the device.
But when try to open the App it is giving the below errors :-

07-20 19:13:54.321 6017-6017/? E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Candidate', referenced from method com.myscript.atk.maw.MathWidget.addSymbol
07-20 19:13:54.321 6017-6017/? E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Candidate', referenced from method com.myscript.atk.maw.MathWidget.addSymbols
07-20 19:13:54.421 6017-6017/? E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.VoTimeStamp', referenced from method com.myscript.atk.maw.uifw.formview.impl.InkView.onTouchEvent

Can please let me know why is this error comming while using Android Studio.


Dear Vinay,

thank you for contacting us.

You can refer to the Use ATK with Android Studio video available at https://dev.myscript.com/support/videos/.

Following this, you should be able to migrate from Eclipse to Android studio.

Best regards,

Olivier

Olivier,
I followed video when i ran the maw-sample project, I got the below error

07-21 18:37:19.719 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Candidate', referenced from method com.myscript.atk.maw.MathWidget.addSymbol
07-21 18:37:19.719 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Candidate', referenced from method com.myscript.atk.maw.MathWidget.addSymbols
07-21 18:37:19.739 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.VoTimeStamp', referenced from method com.myscript.atk.maw.uifw.formview.impl.InkView.onTouchEvent
07-21 18:37:19.809 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Segment', referenced from method com.myscript.atk.maw.view.a.b.a
07-21 18:37:19.819 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.view.a.b.f
07-21 18:37:19.819 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.<init>
07-21 18:37:19.819 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Path', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.829 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.829 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Rect', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.r
07-21 18:37:19.829 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Point', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.829 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.829 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.829 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Char', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Segment', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Candidate', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.839 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.maw.recognition.g', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.849 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Archive', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.a
07-21 18:37:19.849 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Point', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.b
07-21 18:37:19.849 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.b
07-21 18:37:19.849 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.InkField', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.b
07-21 18:37:19.849 4566-4566/com.myscript.atk.maw.sample E/dalvikvm﹕ Could not find class 'com.myscript.atk.styluscore.Archive', referenced from method com.myscript.atk.maw.recognition.RecognizerCore.b
07-21 18:37:19.859 4566-4566/com.myscript.atk.maw.sample E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.myscript.atk.styluscore.InkField
at com.myscript.atk.maw.recognition.RecognizerCore.<init>(Unknown Source)
at com.myscript.atk.maw.view.a.b.a(Unknown Source)
at com.myscript.atk.maw.view.a.b.<init>(Unknown Source)
at com.myscript.atk.maw.MathWidget.configure(Unknown Source)
at com.myscript.atk.maw.sample.SampleActivity.configure(SampleActivity.java:121)
at com.myscript.atk.maw.sample.SampleActivity.onCreate(SampleActivity.java:81)
at android.app.Activity.performCreate(Activity.java:5160)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4962)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
at dalvik.system.NativeStart.main(Native Method)

Please let me know how should i fix this .

Thanks,
Vinay

Less steps are necessary to run only the MathWidget using Android Studio, could you please try once again?

1 Inflate the ATK package
2 replace the default certificate by your own certificate
3 open the ATK package in Android Studio
4 Choose ‘Import Project (Eclipse ADT, gradle, etc…)’
5 Select the root folder where you inflated the ATK resources and press “ok”
6 In the import dialog, just let default selection to “Create project from exiting sources’, and press “Next”
7 Confirm project location by clicking “Next” button
8 Android Studio will detect all projects in sub folders of the ATK root. Press “Next”
9 Then Android Studio (AS) looks for Jar files that can be managed as libraries. This auto detection may misname some of the detected libraries. This is the case for ATK.
9.a So, we start by fixing the name of the first one, called “libs” here. Just press the edit button, in the dialog, enter the new name, here “engine”, as this libraries are related to the recognition engine, then press “ok”
9.b now select android support lib of the single char widget folder. This lib is used by the styluscore module. Press the edit button, in the dialog, enter the new name, here “styluscore” then press “ok”
now select the last library reference, related to styluscore now press the “next” button
10 This dialog shows the modules from the sample folder. The import process applies the names of folders found into the sample directory. As this folder names are the same in sample directory and in libs directory, this process will name several module the same way, and it will induce some conflict. So we have to rename some of the module here.
10.a Select the MAW module, press the edit button, in the edition dialog, enter the new name maw-sample and press “ok” then “Next”
11 Here the aim is to select the Android SDK version used to compile the ATK module. All module are compatible with the Android API level 17. So select if and press “Next”.
12 In this dialog just press the ‘Finish’ button
13 Then AS will propose you to change the dependency links between all detected modules.
Let the dependencies as they are and press “ok”
14 Now the import is done, but the module parameters have to be reviewed, because the automatic process has made some mistake about the libraries and integration.
15 Delete SCW MLTW SLTW GEW modules and keep MAW, MAW-lib, MAW-sample, styluscore, SDK and ATK certificate modules.
16 In the menu, choose ‘File’ then, ‘Project Structure’. Open the ‘Modules’ setting panel.
17 Let’s start with Math widget. Press the “+” button, in the floating menu, select “Library…”, in the dialog, select the library for Math widget, called AtMaw, then press the “add selected” button.
18 Check the box in front of the library lines. Then switch to next module by clicking on MAW-lib module
19 Press the “+” button, in the floating menu, select “Library…”, in the dialog, select the library for styleable project of math widget, called AtkMawStyleable, then press the “add selected” button. Then switch to next module by clicking on MAW-sample module
20 Here we have to remove a library managed into a sub module. So select AtkMaw and press the deletion button. Check the box in front of the library lines. Then switch to next module by clicking on SDK module
21 Press the “+” button? in the floating menu, select “Library…”, in the dialog, select the library that contains reference on recognition libraries, called engine, then press the “add selected” button. Check the box in front of the library line. Then switch to next module by clicking on styluscore module.
22 Press the “+” button, in the floating menu, select “Library…”, in the dialog, select the library for stylus code module, called styluscore, then press the “add selected” button. Check the box in front of the library lines. Then press “ok”
Best regards

Thanks Alot cate,
Now I am able to open the app, but when I try to write something on widget it not showing anything.
So, Now the problem is I am unable to write any thing on widget. How should I proceed on this.

Hi,
A similar issue was reported using Xamarin, is it your case?
http://developer-support.myscript.com/support/discussions/topics/16000007685
Could you please check that the certificate from https://atk.myscript.com/ you use is still valid? Please check the status of your account on your dashboard:
https://dev.myscript.com/dashboard/
Best regards

Login or Signup to post a comment