Class not found exception runtime on Xamarin Binding Project

LuiginoDeTogniLuiginoDeTogni USMember ✭✭
edited April 2016 in Xamarin.Android

Hi,
in my Xamarin Android Binding Project i use an interface IPCLIAE87Events declared on Additions section.
In my activity i declare a class which implements this interface:

[Register("testandroidbinding/PCLEventsImplementation", DoNotGenerateAcw = true)]
public class PCLEventsImplementation : Java.Lang.Object, IPCLIAE87Events
{
    public void OnLibraryStarted(PCLIAE87 p0)
    {
        throw new NotImplementedException();
    }

    public void OnPOSConnected()
    {
        throw new NotImplementedException();
    }

    public void OnPOSDisconnected()
    {
        throw new NotImplementedException();
    }
}

My project correctly compiles and builds, but when i use my custom class (PCLEventsImplementation) which implements abstract insterface, i get this runtime error:

04-29 09:35:17.510 W/monodroid(23147): JNIEnv.FindClass(Type) caught
unexpected exception: Java.Lang.ClassNotFoundException: Didn't find
class "testandroidbinding.PCLEventsImplementation" on path:
DexPathList[[zip file
"/data/app/net.aliaslab.testandroidbinding-1/base.apk
"],nativeLibraryDirectories=[/data/app/net.aliaslab.testandroidbinding-1/lib/arm,
/vendor/lib, /system/lib]] 04-29 09:35:17.510 W/monodroid(23147): at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
[0x0000c] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
04-29 09:35:17.510 W/monodroid(23147): at
Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr
jmethod, Android.Runtime.JValue* parms) [0x00064] in
/Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:195
04-29 09:35:17.510 W/monodroid(23147): at
Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr
jmethod, Android.Runtime.JValue[] parms) [0x0001d] in
/Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:203
04-29 09:35:17.510 W/monodroid(23147): at
Android.Runtime.JNIEnv.FindClass (System.String classname) [0x00007]
in
/Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:494
04-29 09:35:17.510 W/monodroid(23147): at
Android.Runtime.JNIEnv.FindClass (System.Type type) [0x00009] in
/Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:434
04-29 09:35:17.510 W/monodroid(23147): --- End of managed exception
stack trace --- 04-29 09:35:17.510 W/monodroid(23147):
java.lang.ClassNotFoundException: Didn't find class
"testandroidbinding.PCLEventsImplementation" on path: DexPathList[[zip
file
"/data/app/net.aliaslab.testandroidbinding-1/base.apk"],nativeLibraryDirectories=[/data/app/net.aliaslab.testandroidbinding-1/lib/arm,
/vendor/lib, /system/lib]] 04-29 09:35:17.510 W/monodroid(23147): at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-29 09:35:17.510 W/monodroid(23147): at
java.lang.ClassLoader.loadClass(ClassLoader.java:511) 04-29
09:35:17.510 W/monodroid(23147): at
java.lang.ClassLoader.loadClass(ClassLoader.java:469) 04-29
09:35:17.510 W/monodroid(23147): at
md5c37b5090c7953962553837bb65efec6f.MainActivity.n_onCreate(Native
Method) 04-29 09:35:17.510 W/monodroid(23147): at
md5c37b5090c7953962553837bb65efec6f.MainActivity.onCreate(MainActivity.java:29)
04-29 09:35:17.510 W/monodroid(23147): at
android.app.Activity.performCreate(Activity.java:6288) 04-29
09:35:17.510 W/monodroid(23147): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
04-29 09:35:17.510 W/monodroid(23147): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2642)
04-29 09:35:17.510 W/monodroid(23147): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2754)
04-29 09:35:17.510 W/monodroid(23147): at
android.app.ActivityThread.access$900(ActivityThread.java:177) 04-29
09:35:17.510 W/monodroid(23147): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
04-29 09:35:17.510 W/monodroid(23147): at
android.os.Handler.dispatchMessage(Handler.java:102) 04-29
09:35:17.520 W/monodroid(23147): at
android.os.Looper.loop(Looper.java:145) 04-29 09:35:17.520
W/monodroid(23147): at
android.app.ActivityThread.main(ActivityThread.java:5938) 04-29
09:35:17.520 W/monodroid(23147): at
java.lang.reflect.Method.invoke(Native Method) 04-29 09:35:17.520
W/monodroid(23147): at
java.lang.reflect.Method.invoke(Method.java:372) 04-29 09:35:17.520
W/monodroid(23147): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
04-29 09:35:17.520 W/monodroid(23147): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) 04-29
09:35:17.520 W/monodroid(23147): at
de.robv.android.xposed.XposedBridge.main(XposedBridge.java:115) 04-29
09:35:17.520 W/monodroid(23147): Suppressed:
java.lang.ClassNotFoundException:
testandroidbinding.PCLEventsImplementation 04-29 09:35:17.520
W/monodroid(23147): at
java.lang.Class.classForName(Native Method) 04-29 09:35:17.520
W/monodroid(23147): at
java.lang.BootClassLoader.findClass(ClassLoader.java:781) 04-29
09:35:17.520 W/monodroid(23147): at
java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 04-29
09:35:17.520 W/monodroid(23147): at
java.lang.ClassLoader.loadClass(ClassLoader.java:504) 04-29
09:35:17.520 W/monodroid(23147): ... 17 more 04-29
09:35:17.520 W/monodroid(23147): Caused by:
java.lang.NoClassDefFoundError: Class not found using the boot class
loader; no stack available

Demo project is in the attachment
http://cloud.aliaslab.net/public.php?service=files&t=715fe3a47b2b5c365058de7d44f7741a

Thank you for any suggestions!

Lewix

Tagged:

Best Answers

Answers

Sign In or Register to comment.