java.lang.VerifyError Error while compiling JAVA - Matlab production Server answer
Show older comments
Hello guys,
I am trying to create a java ( Specifically android ) client for Matlab production server but I am getting the following error at compile time. I have no clue why this is happening. It has probably something to do with the interface but I have replicated the example provided in the documentation.
Here is the full error trace:
06-28 09:06:25.912 14727-14727/com.example.matlabservertest E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.matlabservertest, PID: 14727
java.lang.VerifyError: com/mathworks/mps/client/internal/InterfaceValidator
at com.mathworks.mps.client.MWHttpClient.createProxy(Unknown Source)
at com.example.matlabservertest.MainActivity.onCreate(MainActivity.java:36)
at android.app.Activity.performCreate(Activity.java:5312)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2552)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2653)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5872)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:852)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:668)
at dalvik.system.NativeStart.main(Native Method)
Here is my code:
public class MainActivity extends AppCompatActivity {
double[][] a1={{1,2,3},{3,2,1}};
double[][] a2={{4,5,6},{6,5,4}};
interface MATLABAddMatrix
{
double[][] addmatrix(double[][] a1, double[][] a2)
throws MATLABException, IOException;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MWClient client = new MWHttpClient();
try {
MATLABAddMatrix m = client.createProxy(new URL("http://13.79.154.85:9910/addmatrix"),
MATLABAddMatrix.class);
double[][] result = m.addmatrix(a1,
a2);
for(double[] i : result){
for (double j : i){
Log.i("RESULT",String.valueOf(j));
}
}
}catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (MATLABException e){
e.printStackTrace();
} finally {
client.close();
}
}
}
Any ideas why this is happening??
Thank you
Answers (0)
Categories
Find more on MATLAB Mobile in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!