I followed the steps Binding a Jar Library.However, once I complie the process ,hundreds of warning was shown to me ,most of it were "couldn't load class" warning. I don't know what should I do.
The version of Xamarin is 5.9.5(build 10).
I'm sorry I haven't enough reputation to post the image. I copied some warning messages here.
D:\project_c#\Android\OsmDroid\OsmDroid\JARTOXML: Warning J2X9001: Couldn't load class microsoft/mappoint/TileSystem : java.lang.ClassNotFoundException: microsoft.mappoint.TileSystem (J2X9001) (OsmDroid)
D:\project_c#\Android\OsmDroid\OsmDroid\JARTOXML: Warning J2X9001: Couldn't load class net/wigle/wigleandroid/ZoomButtonsController$1 : java.lang.ClassNotFoundException: net.wigle.wigleandroid.ZoomButtonsController$1 (J2X9001) (OsmDroid)
D:\project_c#\Android\OsmDroid\OsmDroid\JARTOXML: Warning J2X9001: Couldn't load class net/wigle/wigleandroid/ZoomButtonsController$OnZoomListener : java.lang.ClassNotFoundException: net.wigle.wigleandroid.ZoomButtonsController$OnZoomListener (J2X9001) (OsmDroid)
Try setting the $(AndroidClassParser) MSBuild property to class-parse:
xbuild /p:AndroidClassParser=class-parse
or manually add the property to your .csproj
see - https://gist.github.com/prashantvc/09116d89ec5c8c4d4680d2b956862c0c#file-binding_sdkbase-csproj-L17
Related
I'm trying to use the sdk in a java android project.
I use this sdk :
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.3.0'
When i launch the screen with the Mapview, i got the "getDataNetworkTypeForSubscriber" error
When searching a solution to this error multiple answer tell to import this dependency
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:6.3.0'
But when i launch the screen with this dependecy i got this error :
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/android/telemetry/MapEventFactory;
....
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mapbox.android.telemetry.MapEventFactory" on path: DexPathList[[zip file "/data/app/~~rUziWglMhPfBsvW8AaITbQ==/com.trema.encheres.dev-aI_CEkUkLFmlvawtp7adLQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~rUziWglMhPfBsvW8AaITbQ==/com.trema.encheres.dev-aI_CEkUkLFmlvawtp7adLQ==/lib/arm64, /data/app/~~rUziWglMhPfBsvW8AaITbQ==/com.trema.encheres.dev-aI_CEkUkLFmlvawtp7adLQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
What am I doing wrong ? Is there something i forgot ? A dependency ?
I try to add this dependency
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-core:6.3.0'
but i got the error message when building :
Could not find com.mapbox.mapboxsdk:mapbox-sdk-core:6.3.0.
Thanks
Gradle migration : Unable to instantiate application ClassNotFoundException. Didn't find class “Application” on path: DexPathList
The problem is similar to this
Please check it to see what is happening.
I want to find other reserved words or other things would make this problem.
original Android Jar library file (mposlitesdk.jar) has inside this subfolders content:
com (which has inside subfolder "ingenico" and "zebra")
META-INF
org (which has inside subfolder "apache" with subfolder "commons" and "http")
Library is compiled with target 23 (Android 6.0).
Library mposlitesdk.jar is defined (as usually) as embedded jar
Compiler gives me:
J2XA006 warnings about org.apache.http package which is inside the
library
1>JARTOXML : warning J2XA006: missing class error was raised while
reflecting com.ingenico.pclutilities.PclUtilities :
com/hoho/android/usbserial/driver/UsbSerialPort 1>JARTOXML : warning
J2XA006: missing class error was raised while reflecting
org.apache.http.impl.client.DefaultRequestDirector :
org/apache/commons/logging/Log 1>JARTOXML : warning J2XA006: missing
class error was raised while reflecting
org.apache.http.impl.client.HttpAuthenticator :
org/apache/commons/logging/Log 1>JARTOXML : warning J2XA006: missing
class error was raised while reflecting
org.apache.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage :
net/sf/ehcache/Ehcache 1>JARTOXML : warning J2XA006: missing class
error was raised while reflecting
org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
: net/spy/memcached/OperationTimeoutException 1>JARTOXML : warning
J2XA006: missing class error was raised while reflecting
org.apache.http.impl.conn.HttpConnPool :
org/apache/commons/logging/Log 1>JARTOXML : warning J2XA006: missing
class error was raised while reflecting
org.apache.http.impl.conn.HttpPoolEntry :
org/apache/commons/logging/Log 1>JARTOXML : warning J2XA006: missing
class error was raised while reflecting org.apache.http.impl.conn.Wire
: org/apache/commons/logging/Log 1>JARTOXML : warning J2XA006: missing
class error was raised while reflecting
org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager :
org/apache/commons/logging/Log
strange invalid tokens with char ' are added to generated sources:
obj\Debug\generated\src\Org.Apache.Http.Impl.Client.AbstractAuthenticationHandler.cs(244,65,244,66):
error CS1519: Il token '`' nella dichiarazione del membro di classe,
struttura o interfaccia non è valido
Maybe main issue is about org.apache.http which is duplicated in Xamarin Android namespace?
Thanks for any suggestion
Log is attached
The issue at hand from first glance is that org.apache.http is not playing nicely under API 23. Here's why:
https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client
Google removed org.apache.http and moved it to an optional library. What does that mean for Xamarin.Android? Well it means that it is no longer bound in API 23 since Google doesn't ship it with android.jar. Thus there's a couple workarounds that you can go about:
1) Use any API level between 9-22 (Xamarin.Android will have bindings for this)
2) Add the org.apache.http.legacy.jar to your Binding project as a ReferenceJar if you want to satisfy dependencies and not create C# bindings for it. Or use EmbeddedReferenceJar if you want to embed the .jar and create C# bindings for it.
You can find this .jar in the following location:
android-sdk\platforms\android-23\optional (Or any API level above 23 like API 24/etc will have it)
I have made an Android plugin to use GCM in my Unity app. When I try to start the RegistrationIntentService (readymade example class from Android Developer Manual site), it causes a crash with the exception
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.iid.InstanceID" on path: DexPathList[[zip file "/data/app/com.ex.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.ex.test-1/lib/arm, /vendor/lib, /system/lib]]
I have imported the play-services-9.2.0.unitypackage, without any success. Any help?
For anyone who might want to look for this question answered, I found the solution. The InstanceID.class is not included in the play-services-9.2.0.unitypackage, so include the play-services-iid-9.0.2.aar in the Android -> Plugins folder.
I'm trying to replicate this class called MediaMetadataRetriever in my own android project. You can see the class here:
https://android.googlesource.com/platform/frameworks/base/+/master/media/java/android/media/MediaMetadataRetriever.java
In line # 40 you can see: System.loadLibrary("media_jni");
How do I get that library? My logcat shows this:
Caused by: java.lang.UnsatisfiedLinkError: Library media_jni not found
This is a JNI class, which is created in C/C++ and included as a SO in your app. The class is loaded during runtime.
Look here https://android.googlesource.com/platform/frameworks/base/+/master/media/jni