we're making an Android Binding Library for the Polar SDK. Everything works well except for one method call (setLocalTime() - all other methods work) that fails with the following error:
Java.Lang.Throwable: Failed resolution of: Lprotocol/PftpRequest$PbPFtpSetLocalTimeParams; ---> Java.Lang.ClassNotFoundException: protocol.PftpRequest$PbPFtpSetLocalTimeParams ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/google/protobuf/GeneratedMessageLite; ---> Java.Lang.ClassNotFoundException: Didn’t find class “com.google.protobuf.GeneratedMessageLite”
Does anyone know what could be the cause of this and how to fix it? Any help would be appreciated.
Turns out we were missing dependencies. Not sure why they aren't packaged with the SDK's .aar file. I re-read the SDK's readme and added the right protobuf jar downloaded from the maaven site. The missing jars were marked as EmbeddedReferenceJar in the Xamarin project.
Related
I'm currently updating a Xamarin Forms App and suddenly experiencing this error on Android:
Exception {Java.Lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.GooglePlayServicesUtil" on path: DexPathList[[zip file "/data/app/com.alphacoreconsulting.tflmetrosound-Ek3U1cNyzLe9Jayp9enzXQ==/base.apk"],nativeLibraryDirectories=[/data/app/c…} Java.Lang.ClassNotFoundException
It triggers on this line:
Xamarin.FormsMaps.Init(this, bundle);
I've researched and I've ensured all packages are the same version:
Please would anyone be able to offer some help on this?
UPDATE:
I have since updated the proguard.cfg file and added this line:
-keep public class com.google.android.gms.common.GooglePlayServicesUtil
After adding this I am now experiencing this error:
no static method "Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable(Landroid/content/Context;)I"
You will see this exception at runtime when code has been stripped from the executable usually by the linker or R8/Proguard. You can provide a configuration file to both tools allowing you to keep code the linker or R8/Proguard think you are not using. These tools are not able to properly detect code you use at runtime via reflection for example.
Here is the documentation for the linker configuration file. Another approach is to use a "LinkerPleaseInclude.cs" file manually referencing the code you do not want to be linked out.
Here is the documentation for the R8/Proguard configuration file.
A few days ago I was able to create an android bindings library for a particular .jar without issue.
I attempted to make a new library in order to post a question sample on github, now JarToXml won't generate anything:
1>JARTOXML : warning J2X9001: Couldn't load class device/scanner/ScanConst : java.lang.ClassNotFoundException: device.scanner.ScanConst
1>JARTOXML : warning J2X9001: Couldn't load class device/scanner/ScannerService : java.lang.ClassNotFoundException: device.scanner.ScannerService
.... (Same error for all classes in .Jar)
1>BINDINGSGENERATOR : warning BG8601: No packages found.
I'm totally confused because in one project I can generate the bindings, yet in another I can't.
Jar file: https://github.com/mribbons/PM_Scanner/blob/master/device.scanner.jar?raw=true
Turns out the problem was the path of the 2nd binding library project - Java doesn't like #.
I'm trying to go through the Parse Mealspotting tutorial, but after adding the Parse library I'm getting weird errors. I've found other similar errors while googling, but nothing that has worked. Here's one. I also read to look at Adding the Support Libraries, but that didn't fix it.
Exact text is:
Multiple markers at this line
- The type bolts.Task cannot be resolved. It is indirectly referenced from required .class files
- The class file Task<?> contains a signature 'Ljava/util/Set<Lbolts/Task<*>.TaskCompletionSource;>;' ill-formed at
position 30
I don't care about the support libraries or what devices the app will work on, all I want is for this to work so I can go through the tutorial. Has anyone dealt with this before?
I have also tried creating a project that only supports Kit Kat and removed the support libraries, but it's still throwing the same error.
Try to add the bolts-android-1.1.3 lib in your project. You can find it in the Parse SDK zip file.
First, be sure that you have the Parse library in your lib folder.
I had the same problem and solved it by adding the bolts-android-1.1.3.jar (right click on your project properties and then java build path , tab libraries, add jars or externals jars) that i found in Parse-1.7.1.
Then clean your project and it should work.
I want to use JavaCv with my App on Android.
Therefore I followed the advice here: https://github.com/bytedeco/javacv on how to install Android 2.2 or newer. As a result the following libraries can be found under \libs\armeabi:
libjniopencv_core.so
libopencv_core.so
All classes of both libraries are also present in the classes.dex file of my .apk.
And still i get the following exception:
java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libopencv_core.so" needed by "libjniopencv_core.so"; caused by load_library(linker.cpp:745): library "libopencv_core.so" not found
I tried loading libopencv_core.so via
System.loadLibrary("libopencv_core")
and
System.loadLibrary("opencv_core")
with the same outcome..
Any hint on how to solve this issue would be appreciated.
Edit1:
I had a look to see which .so files could actually be found under /data/app-lib/ccc.android.myappname...
Despite libopencv_core.so and other files can be found under lib/armeabi/ in my .apk only some of them are available for my activity under /data/app-lib/ccc.android.myappname. The others are just ignored for some unknown reason.
Can somebody help, i have no idea what is going on.
Thank you.
Here the solution i found:
I discussed this matter on the JavaCv board on Github:
https://github.com/bytedeco/javacv/issues/28
The Issue might be history with the next release, but for the meantime do as follows:
Before using JavaCv for the first time run:
static {
System.loadLibrary("tbb");
System.loadLibrary("opencv_core");
System.loadLibrary("jniopencv_core");
}
On some devices (or occasion) the intended load order get mixed up...
when I use jsoup.jar in android ,the problem is:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added:
...
Conversion to Dalvik format failed with error 1
Couldn't the jsoup.jar used in android?
I search a lot materials, but it does't works!
Help!
You have same jar library included twice. Check your application and all referenced Android libraries and make sure you have all jars included exactly once.