Java.Lang.ClassNotFoundException Android Studio: Java

i have my code:

 String myUrl = "http://10.10.1.108:9047/bin";
        URI myURI = new URI(myUrl);
        IDataService data = new DataService_Proxy(myURI);
        AppUsuario ap = data.IniciarSesion("USER","PASSWORD");

I get the error in AppUsuario class.lang.ClassNotFoundException.

My classes in com.example.myapplication:
-AppBase.Java
-AppUsuario.Java(Extends AppBase)
-MainActivity.java
-DataService_AsyncProxy
-DataService_Proxy
-Defines_RPServicioApp
-IDataService
-IDataService_Async
-com.remobjects.sdk.jar (added like library).

In Xcode is Working correctly with the same server.


Which class is not found? If it’s from an external reference, is that reference set to copy-local?

Hello

Could you please send RODL of your server to support@ (it will be kept private)

Thanks in advance

is a local server, but in xcode is working correctly.

AppUsuario.Java (Generated in service importer) is inside of the project.

What is the name of the class that is not found?

“java.lang.ClassNotFoundException: AppUsuario”

AppUsuario I Guess, i received that error.

Ok, I assume AppUsuario is declared in your project, presumably in your Intf file? I dont see it in the above list you posted. If you look inside your .jar or .apk file, is it there? Can you send me the .apk and the source (via PM)?

It is in my project, in the file AppUsuario.Java, the project is compiled sucesfully and i get the error when i launch or debug the project

Then I don’t know — this seems to be an issue specific to Android Studio, not related to Remoting SDK…

Hello

Please check the DataService_Proxy.java file.

There find the constructor of the DataService_Proxy class and check the 2nd line of it.

If it looks like

com.remobjects.sdk.TypeManager.setPackage("PackageName");

then change the PackageName string to your package name and check all other similar code lines in your project. It seems you forgot to chenge the package name to a correct one while you generated the proxy code files:

Also please note that you are trying to perform a synchronous service call. Android won’t allow you to perform a synchronous network operation from a main thread so you’ll have to either run iti na separat thread or to use the async service proxy instead.

Regards

this is my DataService_Proxy

By the way, when i use a method returning only a String is working correctly.

String is a primitive type so serializer is able to instantiate and read it without any additional info.

At the same time complex types required to be registered properly. That’s why setPackage calls should provide correct package name (I guess in your case this is com.example.myapplication, not the string on your code screenshot )

Its almost as of the types are eliminated from the package, maybe by some optimization process?

Captura de Pantalla 2020-02-21 a la(s) 15.41.28

Its Worked Thanks, i added a “import RpServicio.*;” to the MainActivity.