Can`t run on Android device, because of librabries - java

I'm launching a game on Android device and getting this error. I`m using up to date Android version, also libgdx.
The library 'jinput-platform-2.0.5-natives-linux.jar' contains native libraries that will not run on the device.
The following libraries were found:
libjinput-linux.so
libjinput-linux64.so
Please help me understand what may cause the problem.

*.so files are native assemblies that are built for a particular architecture. If those *.so files were not built for android (and it seems as if they are not given the error) they will not work.
If there isn't a version for android already built, you can try to write an android version. This other SO question may be of assistance.

Related

Binding to c# some java-code, that uses .so libraries

There are some .so libraries and java code uses them for android.
I compile this java code within android studio to get an .aar file. I need to make binding for c# code fo Xamarin.Android using Visual Studio. So, while binding with java is working good, the java code throws exception:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader
Through the seeing of full exception message I got that java code can't find .so files. In the Android Studio project .so libs are settled at ./lib/armeabi-v7a/, and the java code works well.
So, the question is: where should I put .so libs in C# binding library? Some inner scent tips me I should put it somewhere -- that's the way libraries work.
I've tried to put .so libraries in directory with my .dll, also deeper in ./lib/armeabi-v7a/, but it actually didn't help -- the exception was the same. I've tried to put them in the directory with my .aar file and also in the deeper directory in ./lib/armeabi-v7a/ but this is kinda of shamanism. it's also didn't help.
the problem was in the way I tried to check the work of program. My Android emulator didn't have the armeabi-v7a support. After I tried to change my emulator settings. it became laggy and very slow. The issue was to test an application on real device.

bazel build error - tensor flow

I am struggling to put my model in the Android studio.
In order to use my model in the Android studio, I also know that I need to put the libandroid_tensorflow_inference_java.jar and libtensorflow_inference.so files into the assets folder in Android Studio.
So I used git to download the tensorflow library and use it to build .so and .jar files.
During the creation of the .so file I faced a problem that I could not solve.
I installed the SDK in the Android studio according to the procedure, and since I currently only support NDK version 17 in the studio, I installed version 12 externally and unzipped it.
~/tensorflow/WORKSPACE
In order to build a bazel, I modified the content of WORKSPACE in the root folder of tensorflow as shown above. this
But I had to face these terrible errors.
this this
To solve this problem, I changed the NDK location and installed another version of NDK. I tried to take other actions but the error did not go away. I have been working from yesterday to solve this problem. I need your help.
It looks like you're missing the -std=c++11 flag.
Try passing this additional Bazel flag: --cxxopt=-std=c++11.

link dll and jar file to android studio

This question might seem too basic but I'm struggling a lot about this stuff, please help me or guide me.
I downloaded opencv (open source computer vision) libraries and I want Android Studio to be able to use those libraries.
I checked this answer also-How to use opencv in android studio using gradle build tool?
but this answer talks about having opencv-android-sdk and nowadays I think opencv has not anything like opencv-android-sdk , so I couldn't follow that answer.
Now the main point is, what I downloaded and extracted has a folder named java , there is a opencv-320.jar file and two folder x86 and x64, x64 folder contains opencv_java320.dll file. I believe these two files are only files needed to get opencv libraries in Android Studio. But I don't know how it can be done. Please help me.
You should not be using any dll or jar file that is not specifically for Android.
OpenCV has an Android version: http://opencv.org/platforms/android/
Follow the instructions and example there in order to use it.

Qt5 Android deployment issue

Two years ago I developed a Qt4 Android app using Ministro and it worked perfectly in that time. Right now I am porting the same code into Qt5. After updating several files I could compile and create the APK file in a pretty clean way.
Nevertheless, when I try to deploy the app into my tablet, it crashes showing these two error messages:
No implementation found for int[] org.qtproject.qt5.android.ExtractStyle.extractNativeChunkInfo()
And:
E/libEGL (11187): cache file failed CRC check
These are my settings:
QtCreator with Qt 5.5.1
Android Studio (Android 5.0.1 - API Level 21)
Android NDK (r10e)
Ant (1.9.6)
JDK (1.8.0_73)
Note: I tried to deploy my app from a virtual android device (using API 23) and I got the same result.
Finally I could solve the problem in a very strange way: I removed all the Android references in my code, including the android manifest.
In other words, I transformed my app into a "desktop" solution. Then, from QtCreator I made the deployment pointing to android and everything worked in a pretty clean way. I wonder how Qt solutions have evolved as an actual resource for mobile development in just few years.

Use jNAOqi with Android

I'm currently working with Aldebaran-Robotics' NAO (v3.3) and I was wondering if I can use the jNAOqi-SDK within Android to control the robot from a phone or tablet.
Using the SDK with basic java in Eclipse was pretty simple as described in this tutorial, so I tried to do this in ADT Eclipse. I imported the *.jar-file and placed the precompiled libjnaoqi.so from the package in libs/armeabi and libs/armeabi-v7a, but calling System.loadLibrary("jnaoqi") or System.loadLibrary("<jnaoqi>") resulted in the following error at runtime:
I/dalvikvm(2019): Unable to dlopen(/data/data/com.example.hellonao/lib/libjnaoqi.so): Cannot load library: link_image[1995]: failed to link libjnaoqi.so
I checked the filesystem, but the file was in the lib folder as expected, so I guess it has to be a problem with the library itself.
It's just a shot in the dark but do I have to recompile the library using ndk and naoqi?
I quickly abandoned my project but Aldebaran was busy in the meantime. I recently found a thread about it in the Aldebaran community (login required), where two employees (Nicolas Rigaud and Erwan Pinault) mention upcoming Android support.
nrigaud:
there will be a better Java SDK on our next software version. Meanwhile, it's true that it's not that easy to do Java on the robot
epinault:
In the next SDK you will have library (jar/so) for android

Categories