You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an aar native library that uses reflection to resolve json serialization (kotlinx-serialization-json-jvm-1.6.3.jar properly added too) in native the library works properly but when i put in my binding project and test it i receive this error:
Java.Lang.Error: Unresolved class: class java.lang.String (kind = null)
that becomes from the use of "Reflection.typeOf(String.class)" in the native library.
I tried to inject the class on the runtime but does not work, also i tried to get the class by name in my test project but this works correctly creating a Java.Lang.String class correctly:
When a native library tries do deserialize using reflection
Net Android Binding does not able to resolve the classes
Did you find any workaround?
No response
Relevant log output
Java.Lang.Error: Unresolved class: class java.lang.String (kind = null)
at Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 20370
at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 66
at Com.Minsait.Veridas_android_sdk.VeridasHelper.StartDocumentCapture(IVeridasListener listener, Context applicationContext, IList`1 docs, IDictionary`2 configuration)
at TestNet.MainActivity.<>c__DisplayClass8_0.<OnCreate>b__0(Object o, EventArgs e) in /Users/movilidad/Develop/Minsait/Librerias/XXXXXXiosxamarin/BindingXamarinAndroid/TestNet/MainActivity.cs:line 74
at Android.Views.View.IOnClickListenerImplementor.OnClick(View v) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 2410
at Android.Views.View.IOnClickListenerInvoker.n_OnClick_Landroid_view_View_(IntPtr jnienv, IntPtr native__this, IntPtr native_v) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 2374
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 121
--- End of managed Java.Lang.Error stack trace ---
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Unresolved class: class java.lang.String (kind = null)
at kotlin.reflect.jvm.internal.KClassImpl.createSyntheticClassOrFail(KClassImpl.kt:340)
at kotlin.reflect.jvm.internal.KClassImpl.access$createSyntheticClassOrFail(KClassImpl.kt:49)
at kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:67)
at kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:53)
at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
at kotlin.reflect.jvm.internal.KClassImpl$Data.getDescriptor(KClassImpl.kt:53)
at kotlin.reflect.jvm.internal.KClassImpl.getDescriptor(KClassImpl.kt:193)
at kotlin.reflect.jvm.internal.KClassImpl.getDescriptor(KClassImpl.kt:49)
at kotlin.reflect.full.KClassifiers.createType(KClassifiers.kt:47)
at kotlin.reflect.jvm.internal.CachesKt$CACHE_FOR_BASE_CLASSIFIERS$1.invoke(caches.kt:37)
at kotlin.reflect.jvm.internal.CachesKt$CACHE_FOR_BASE_CLASSIFIERS$1.invoke(caches.kt:36)
at kotlin.reflect.jvm.internal.ConcurrentHashMapCache.get(CacheByClass.kt:92)
at kotlin.reflect.jvm.internal.CachesKt.getOrCreateKType(caches.kt:55)
at kotlin.reflect.jvm.internal.ReflectionFactoryImpl.typeOf(ReflectionFactoryImpl.java:123)
at kotlin.jvm.internal.Reflection.typeOf(Reflection.java:128)
at com.XXXXXX.resource.database.ResourcesDatabase$parseDocIdsByCountryMap$2.invokeSuspend(ResourcesDatabase.kt:232)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
--- End of managed Java.Lang.Error stack trace ---
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Unresolved class: class java.lang.String (kind = null)
at kotlin.reflect.jvm.internal.KClassImpl.createSyntheticClassOrFail(KClassImpl.kt:340)
at kotlin.reflect.jvm.internal.KClassImpl.access$createSyntheticClassOrFail(KClassImpl.kt:49)
at kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:67)
at kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:53)
at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
at kotlin.reflect.jvm.internal.KClassImpl$Data.getDescriptor(KClassImpl.kt:53)
at kotlin.reflect.jvm.internal.KClassImpl.getDescriptor(KClassImpl.kt:193)
at kotlin.reflect.jvm.internal.KClassImpl.getDescriptor(KClassImpl.kt:49)
at kotlin.reflect.full.KClassifiers.createType(KClassifiers.kt:47)
at kotlin.reflect.jvm.internal.CachesKt$CACHE_FOR_BASE_CLASSIFIERS$1.invoke(caches.kt:37)
at kotlin.reflect.jvm.internal.CachesKt$CACHE_FOR_BASE_CLASSIFIERS$1.invoke(caches.kt:36)
at kotlin.reflect.jvm.internal.ConcurrentHashMapCache.get(CacheByClass.kt:92)
at kotlin.reflect.jvm.internal.CachesKt.getOrCreateKType(caches.kt:55)
at kotlin.reflect.jvm.internal.ReflectionFactoryImpl.typeOf(ReflectionFactoryImpl.java:123)
at kotlin.jvm.internal.Reflection.typeOf(Reflection.java:128)
at com.XXXXXX.resource.database.ResourcesDatabase$parseDocIdsByCountryMap$2.invokeSuspend(ResourcesDatabase.kt:232)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
The text was updated successfully, but these errors were encountered:
Android framework version
net8.0-android
Affected platform version
Jetbrains Rider 2024.3.5
Description
I have an aar native library that uses reflection to resolve json serialization (kotlinx-serialization-json-jvm-1.6.3.jar properly added too) in native the library works properly but when i put in my binding project and test it i receive this error:
Java.Lang.Error: Unresolved class: class java.lang.String (kind = null)
that becomes from the use of "Reflection.typeOf(String.class)" in the native library.
I tried to inject the class on the runtime but does not work, also i tried to get the class by name in my test project but this works correctly creating a Java.Lang.String class correctly:
Java.Lang.Class stringClass = Java.Lang.Class.ForName("java.lang.String");
Steps to Reproduce
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: