OSVR/OSVR-Android-Build

issue inside JAR

zziz opened this issue · 2 comments

zziz commented

There is a error when I try to start server in Android version, inside a project which has been packed into JAR. Error is related to access try to null point. More specifically,
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid.

The same project works well, if it hasn't been packed into JAR. This issue is not related to assets, required files for OSVR Server, as required files are pushed into app directory manually.

Could you describe what you mean by packing a project into the JAR? The current sample has the plugin and config files in the project's assets directory, which gets built into the application package as installed onto the device. At runtime, it then copies files from the package into the app's private data directory. If you are packaging up the plugins and config files in a different way (a separate JAR file, perhaps?), then you'll need to make sure you copy them into the data folder and set the CWD to that directory, as the sample does.

See https://github.com/OSVR/OSVR-Android-Samples/blob/master/OSVROpenGL/app/src/main/java/com/osvr/android/utils/OSVRFileExtractor.java for the code that copies the files from assets into the data directory.

See also https://github.com/OSVR/OSVR-Android-Samples/blob/master/OSVROpenGL/app/src/main/jni/main.cpp#L245 which sets the CWD to the app's data path, so that the server can find plugins.

zziz commented

As I explained in email, implemented server-client uses JointClientKit and that functionality is a part of library. Sample applications that has dependency on library (in Android studio), works well, but once library exported as JAR file (library.jar) and applications are implemented using this .jar file gives error. Its a weird issue that I can't figure out.