J
J
JULIKK2014-07-20 13:27:33
Android
JULIKK, 2014-07-20 13:27:33

Error when initializing java class in xamarin, how to port java libraries correctly?

I want to export a simple java class to xamarin through the binding library, here is the code of this class:

package Native;

public class Test {
  
  public Test(){
    //ctor
  }

  public static String RunGO(String i){
    i = i+ "who is why";
    return i;
  }
  
public static  void Run(){
 
}
}

so i am trying to use it in c# code
Native.Test.Run();
          
           var a = Native.Test.RunGO("sd");
            var test = new Native.Test();

when executing the program, executing the static methods of this class works fine, but during initialization of the class instance: var test = new Native.Test(); i get an error
An unhandled exception occurs.

and
Unhandled Exception:
Java.Lang.CloneNotSupportedException: Loading...

this error occurs when this line tries to execute
JNIEnv.CallVoidMethod(Handle, id_ctor); (this line is in the generated class using BindingLibrary ) who faced this error and how to deal with it?
ps android version 2.3.3 (API 10) and jar assembly included as EmbeddedJar

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question