android project with odatajclient library gives runtime error - android

I am developing android application using odatajclient library . App works fine if I build it through maven android plugin . But when I create android project and provide all the dependencies at runtime I am getting following class not found error
05-05 14:40:10.895: E/AndroidRuntime(14596): java.lang.NoClassDefFoundError: org.w3c.dom.bootstrap.DOMImplementationRegistry
Can anyone help me on this please?

I was able to resolve it by using apache olingo and the following sample:
https://github.com/Tirasa/olingoClientOnAndroidSample
When you initially run maven, it produces single jar for android client, which works perfectly fine at least for me.

IF you are using Eclipse (Juno or above) : Right Click->properties->Build path->order export
Here select all the libraries. It will not be sufficient to just add the libraries through libraries.

Related

How to effectively add dependency .aar file in Xamarin project?

I am trying to create a Xamarin project using PayTM android library. Since PayTM doesn't have a direct Xamarin binding I have added the appinvokesdk-1.2.aar in the Xamarin Android Biding library project. The build action for appinvoke is "LibraryProjectZip". Now the appinvoke library also have a runtime dependency on easypay-8.7.3-appinvoke.aar (I found this after checking the pom file for appinvoke.aar file). I have set the build action for the easypay aar file as "EmbdedJar". I have also tried setting it to "LibraryProjectZip","ReferenceJar" and "EmbeddedReferenceJar". During runtime I am getting the error as
Java.Lang.ClassNotFoundException: Didn't find class "easypay.listeners.WebClientListener" on path: DexPathList[[zip file "/data/app/com.edmatix.poc.paytmdemo1-WQf3uMctjbNHoAG_ZfsH3A==/base.apk"],nativeLibraryDirectories=[/data/app/com.edmatix.poc.paytmdemo1-WQ…}
Here is my environment details
Visual Studio for Mac 8.5.4 (Build 12)
AndroidX assemblies
Xamarin.Form 4.6.0.726
Android Minimum API version 22
Android Target API 28 (Android 9)
the class easypay.listeners.WebClientListener is only required during run time and not during compile time.
Can you please help about how to properly embed the dependency library?
Thanks
so this is what I did to solve the issue of missing .aar file during runtime. I added the second .aar file (easypay-8.7.3-appinvoke.aar) into another Xamarin binding project (as shown in here) and set the compile type as LibraryProjectZip. And that solved my issue with not finding the class in runtime.
Thanks
Please try to install Xamarin.Kotlin.StdLib in your Xamarin Android project. Installing the Kotlin package worked for me because I was using the .aar file which contains Kotlin code.
Install-Package Xamarin.Kotlin.StdLib -Version 1.3.50.1

libtensorflow_demo.so not found, tracking unavailable

I'm trying the object detection API (Git repo) from Tensorflow with android and when I build the project with bazel everything works fine and the libstensorflow_demo.so is there and loads normally. But when I try to to build the project with Gradle only and manually add the library to the JniLibs following this and this Github issue but I get the error mentioned in the title with an other error :
ObjectTracker: Native object tracking support not found. See tensorflow/examples/android/README.md for details.
Anyone encountered this problem?

Noclassdeffound exception com.parse.Parse in android

I am using parse-1.9.3.jar file in my eclipse tool for android development, but i am facing the noclassdeffoundexception while am running my app and my app is crashed. How to fix this issue, i am very much struggle in this point.
I followed some points
I download the parse-1.9.3.jar, copy and paste in lib folder then right click on that parse-1.9.3.jar file then i clicked add to build, this way is not working
Right click project--> project properties--> order and export tab --> checked android private libraries and parse-1.9.3.jar file, this way not worked
java.lang.NoClassDefFoundError: com.parse.Parse --> no use
Libraries do not get added to APK anymore after upgrade to ADT 22 --> NO use
NoClassDefFoundError with parse -->no use
https://en.wikipedia.org/wiki/Classpath_%28Java%29 this is also no use
Please help for how to fix this error and run my app successfully
Thanks in advance

Error using OpenCV Android libs in Android Studio

I've followed this stack overflow answer to try and get OpenCV android working in Android Studio. I have followed the directions with the following caveats:
The build tools version in the opencv build.gradle is 19.1.0 instead of 19.0.1
Instead of looking like the picture provided after a gradle sync, my project structure looks like this:
When I open the module dialog, opencv appears as a model, as well as app
The project builds and autocompletes fine. However, I get the following error when the code that requires OpenCV is called:
java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.core.Mat.n_Mat:()
I have no idea what I am doing wrong. Any help is appreciated.
You have to explicitly load libs with LoadLibrary:
http://developer.android.com/reference/java/lang/System.html

NoClassDefFoundError: org.slf4j.LoggerFactory on an Android applicaton with Graphhopper

I am currently developing an Android application and I'd like to use Graphhoper 0.3 embedded in the application (I have no way of setting up a server).
I am working with Android 4.0, Eclipse Kepler, Maven 3.2.1, Android for Maven Eclipse 1.0.1.
I first tried to pull branch 0.3 and set the "core" folder up as an Eclipse project, then adding it in the Build Path of my android project. I also tried to use the graphhopper-0.3-android.jar directly.
Android Project Main Activity onStart():
GraphHopper hopper = new GraphHopper().forMobile();
Unfortunately, everytime I got the following error:
java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory
It does not pop in a regular Java project; only in Android.
I've tried to add the slf4j JAR's to the build path, with no success.
Any help would be greatly appreciated! It's my first post here, and I really don't know what I could try more. If you need any more information on my setup or anything, please ask!
Edit
Complete solution in comments of the validated answer.
Because you are trying to use Graphhopper directly, the Maven is not downloading all the dependencies of the Graphhopper. In order to fix this, you should either add the Graphhopper as Maven dependency, or try to resolve the dependencies 'by hand' - i.e. by adding missing classes to the build path and exporting them to the APK (if you are using Maven, then simply add the dependencies to the pom.xml without scope tag).

Categories

Resources