I am currently developing a Xamarin app and all of a sudden my Android app started crashing on LoginActivity. I have researched a lot on "
Java.Lang.ClassNotFoundException: Didn't find class
"android.support.v7.appcompat.R$styleable" on path
"
Tried things like updating Android SDK, deleting bin and obj folder. Looking at stacktrace it seems to be an issue with MvvmCross. Currently I am using 3.5.1 of MvvmCross.
Another fact is that I am the only one in team who is facing this issue.
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable; ---> Java.Lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/org.cancer.fundraising-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cancer.fundraising-1/lib/x86, /vendor/lib, /system/lib]]
[MonoDroid] --- End of managed exception stack trace ---
[MonoDroid] java.lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/org.cancer.fundraising-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cancer.fundraising-1/lib/x86, /vendor/lib, /system/lib]]
[MonoDroid] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[MonoDroid] at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:118)
[MonoDroid] at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
[MonoDroid] at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
[MonoDroid] at md5da1044ae077a2d5a79e87e5c6bedf113.LoginActivity.n_onCreate(Native Method)
[MonoDroid] at md5da1044ae077a2d5a79e87e5c6bedf113.LoginActivity.onCreate(LoginActivity.java:31)
[MonoDroid] at android.app.Activity.performCreate(Activity.java:5990)
[MonoDroid] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
[MonoDroid] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
[MonoDroid] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
[MonoDroid] at android.app.ActivityThread.access$800(ActivityThread.java:151)
[MonoDroid] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
[MonoDroid] at android.os.Handler.dispatchMessage(Handler.java:102)
[MonoDroid] at android.os.Looper.loop(Looper.java:135)
[MonoDroid] at android.app.ActivityThread.main(ActivityThread.java:5254)
[MonoDroid] at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid] at java.lang.reflect.Method.invoke(Method.java:372)
[MonoDroid] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
[MonoDroid] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
[MonoDroid] Suppressed: java.lang.ClassNotFoundException: android.support.v7.appcompat.R$styleable
[MonoDroid] at java.lang.Class.classForName(Native Method)
[MonoDroid] at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[MonoDroid] at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[MonoDroid] ... 19 more
[MonoDroid] Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
[MonoDroid] --- End of inner exception stack trace ---
[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xa047bf80 + 0x0002b> in <filename unknown>:0
[MonoDroid] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) <0xa2007008 + 0x000b3> in <filename unknown>:0
[MonoDroid] at Android.App.Activity.OnCreate (Android.OS.Bundle savedInstanceState) <0xa1018918 + 0x0014f> in <filename unknown>:0
[MonoDroid] at ACS.FundRaising.Android.MvxActionBarEventSourceActivity.OnCreate (Android.OS.Bundle bundle) <0xa047b4e0 + 0x00037> in <filename unknown>:0
[MonoDroid] at ACS.FundRaising.Android.LoginActivity.OnCreate (Android.OS.Bundle bundle) <0xa047b278 + 0x0001b> in <filename unknown>:0
[MonoDroid] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) <0xa116f9b0 + 0x00057> in <filename unknown>:0
[MonoDroid] at (wrapper dynamic-method) System.Object:dd5e6f9d-f207-497c-b5c3-0a2c9dac76e7 (intptr,intptr,intptr)
[MonoDroid] --- End of managed exception stack trace ---
[MonoDroid] java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;
[MonoDroid] at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:118)
[MonoDroid] at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
[MonoDroid] at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
[MonoDroid] at md5da1044ae077a2d5a79e87e5c6bedf113.LoginActivity.n_onCreate(Native Method)
[MonoDroid] at md5da1044ae077a2d5a79e87e5c6bedf113.LoginActivity.onCreate(LoginActivity.java:31)
[MonoDroid] at android.app.Activity.performCreate(Activity.java:5990)
[MonoDroid] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
[MonoDroid] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
[MonoDroid] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
[MonoDroid] at android.app.ActivityThread.access$800(ActivityThread.java:151)
[MonoDroid] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
[MonoDroid] at android.os.Handler.dispatchMessage(Handler.java:102)
[MonoDroid] at android.os.Looper.loop(Looper.java:135)
[MonoDroid] at android.app.ActivityThread.main(ActivityThread.java:5254)
[MonoDroid] at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid] at java.lang.reflect.Method.invoke(Method.java:372)
[MonoDroid] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
[MonoDroid] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
[MonoDroid] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/org.cancer.fundraising-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cancer.fundraising-1/lib/x86, /vendor/lib, /system/lib]]
[MonoDroid] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[MonoDroid] ... 18 more
[MonoDroid] Suppressed: java.lang.ClassNotFoundException: android.support.v7.appcompat.R$styleable
[MonoDroid] at java.lang.Class.classForName(Native Method)
[MonoDroid] at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[MonoDroid] at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[MonoDroid] ... 19 more
[MonoDroid] Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
[Mono] Assembly Ref addref GoogleAnalytics.Core[0xb429abe0] -> System.Net.Http[0xaed233a0]: 3
[Mono] Assembly Ref addref GoogleAnalytics.Core[0xb429abe0] -> System.Core[0xb4387580]: 7
[Mono] Assembly Ref addref System.Net.Http[0xaed233a0] -> System[0xb4387760]: 10
[Mono] Assembly Ref addref System.Net.Http[0xaed233a0] -> System.Core[0xb4387580]: 8
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable; ---> Java.Lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/org.cancer.fundraising-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cancer.fundraising-1/lib/x86, /vendor/lib, /system/lib]]
[mono-rt]
[mono-rt] --- End of managed exception stack trace ---
[mono-rt] java.lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/org.cancer.fundraising-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cancer.fundraising-1/lib/x86, /vendor/lib, /system/lib]]
[mono-rt] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[mono-rt] at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[mono-rt] at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[mono-rt] at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:118)
[mono-rt] at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
[mono-rt] at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
[mono-rt] at md5da1044ae077a2d5a79e87e5c6bedf113.LoginActivity.n_onCreate(Native Method)
[mono-rt] at md5da1044ae077a2d5a79e87e5c6bedf113.LoginActivity.onCreate(LoginActivity.java:31)
[mono-rt] at android.app.Activity.performCreate(Activity.java:5990)
[mono-rt] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
[mono-rt] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
[mono-rt] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
[mono-rt] at android.app.ActivityThread.access$800(ActivityThread.java:151)
[mono-rt] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
[mono-rt] at android.os.Handler.dispatchMessage(Handler.java:102)
[mono-rt] at android.os.Looper.loop(Looper.java:135)
[mono-rt] at android.app.ActivityThread.main(ActivityThread.java:5254)
[mono-rt] at java.lang.reflect.Method.invoke(Native Method)
[mono-rt] at java.lang.reflect.Method.invoke(Method.java:372)
[mono-rt] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
[mono-rt] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
[mono-rt] Suppressed: java.lang.ClassNotFoundException: android.support.v7.appcompat.R$styleable
[mono-rt] at java.lang.Class.classForName(Native Method)
[mono-rt] at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[mono-rt] at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[mono-rt] at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[mono-rt] ... 19 more
[mono-rt] Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
[mono-rt]
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xa047bf80 + 0x0002b> in <filename unknown>:0
[mono-rt] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) <0xa2007008 + 0x000b3> in <filename unknown>:0
[mono-rt] at Android.App.Activity.OnCreate (Android.OS.Bundle savedInstanceState) <0xa1018918 + 0x0014f> in <filename unknown>:0
[mono-rt] at ACS.FundRaising.Android.MvxActionBarEventSourceActivity.OnCreate (Android.OS.Bundle bundle) <0xa047b4e0 + 0x00037> in <filename unknown>:0
[mono-rt] at ACS.FundRaising.Android.LoginActivity.OnCreate (Android.OS.Bundle bundle) <0xa047b278 + 0x0001b> in <filename unknown>:0
[mono-rt] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) <0xa116f9b0 + 0x00057> in <filename unknown>:0
[mono-rt] at (wrapper dynamic-method) System.Object:dd5e6f9d-f207-497c-b5c3-0a2c9dac76e7 (intptr,intptr,intptr)
[mono-rt] --- End of managed exception stack trace ---
[mono-rt] java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;
[mono-rt] at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:118)
[mono-rt] at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
[mono-rt] at android.support.v7.app.AppCompatActivity.onCreate(AppCompa
In my case a solution Clean was necessary to get it working.
This issue is resolved by Re-Cloning the repository. Still I don't know what caused the issue but I ended up wasting lot of time. I tried things like;
Removing and downloading packages
Deleting Obj/Bin
Deleting appcompat from android SDK install folder and re-downloading it
Using component instead of package
Probably build output generated some garbage resulting in such issue.
Related
After update to xamarin forms 3.6->4.2, prism.Autofac.Forms 7.0->7.1, and xamarin.android.support.% 28.0.0.1->28.0.0.3 I'm getting
System.TypeLoadException
Message=VTable setup of type Prism.Autofac.AutofacContainerExtension failed
stack trace:
at Prism.PrismApplicationBase.Initialize () [0x00000] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:130
at Prism.PrismApplicationBase.InitializeInternal () [0x00006] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:84
at Prism.PrismApplicationBase..ctor (Prism.IPlatformInitializer platformInitializer, System.Boolean setFormsDependencyResolver) [0x00038] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:75
at Prism.PrismApplicationBase..ctor (Prism.IPlatformInitializer platformInitializer) [0x00000] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:57
at Prism.Autofac.PrismApplication..ctor (Prism.IPlatformInitializer platformInitializer) [0x00000] in D:\a\1\s\Source\Xamarin\Prism.Autofac.Forms\PrismApplication.cs:30
at DisMobi.App..ctor (Prism.IPlatformInitializer initializer) [0x00000] in C:...........\App.xaml.cs:28
at xxxxxx.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00079] in C:..........\xxxxxx.Android\MainActivity.cs:35
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in :0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.3(intptr,intptr,intptr)
I am sometimes getting the following exception:
Unhandled Exception: Android.Runtime.JavaProxyThrowable: Exception of type 'Android.Runtime.JavaProxyThrowable' was thrown.
--- End of managed Android.Runtime.JavaProxyThrowable stack trace ---
android.runtime.JavaProxyThrowable: System.NotSupportedException: Unable to activate instance of type TaxiTabletUniversal.Droid.Views.SoftMeterView from native handle 0xbe8cfb2c (key_handle 0x369e8281). ---> System.MissingMethodException: No constructor found for TaxiTabletUniversal.Droid.Views.SoftMeterView::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x0017d] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000b9] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object.GetObject[T] (System.IntPtr jnienv, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00006] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Android.Views.ViewTreeObserver+IOnGlobalLayoutListenerInvoker.n_OnGlobalLayout (System.IntPtr jnienv, System.IntPtr native__this) [0x00000] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at (wrapper dynamic-method) System.Object.90422e09-526e-4347-b02e-8c2980bde53e(intptr,intptr)
at mvvmcross.droid.views.MvxActivity.n_onGlobalLayout(Native Method)
at mvvmcross.droid.views.MvxActivity.onGlobalLayout(MvxActivity.java:84)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:986)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2221)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1306)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7031)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:821)
at android.view.Choreographer.doCallbacks(Choreographer.java:606)
at android.view.Choreographer.doFrame(Choreographer.java:576)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:807)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6914)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
with the bit that stands out from that exception saying :
No constructor found for TaxiTabletUniversal.Droid.Views.SoftMeterView::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
But the class SoftmeterView (derived from MvxActivity) does have 2 constructors:
public SoftMeterView() : base()
{
MoveTaskToBack(true);
IsCreated = true;
}
with the second one matching the exact signature the exception is complaining about:
public SoftMeterView(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
MoveTaskToBack(true);
IsCreated = true;
}
any thoughts ?
I am working on an android app using Xamarin and receive the following exception.
Xamarin caused by: android.runtime.JavaProxyThrowable: System.ArgumentException: Handle must be valid.
Parameter name: instance
at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0000d] in <1bc3ec2e392f4f1a8cde1c9a163d2a4a>:0
at Android.Runtime.JNIEnv.CallVoidMethod (System.IntPtr jobject, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x0000e] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at Android.Support.V4.Widget.SwipeRefreshLayout.set_Refreshing (System.Boolean value) [0x00060] in <27c17fe440cf491ba8255bcefade6e02>:0
at Xamarin.Forms.Platform.Android.ListViewRenderer.<UpdateIsRefreshing>b__25_0 () [0x00000] in <a3e44144fef249b0888b761605dfca24>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at (wrapper dynamic-method) System.Object:ffc21647-8320-4065-b329-c8e7939eb92d (intptr,intptr)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I've tried adding a txt file, environment.txt, with the property to set the GC to old. However that did not work.
What other issues could cause this exception?
I am binding the java library Material CalendarView. With a set of 12 transforms in Metadata.xml I could bind the library with 0 errors and 15 warnings. I have added Support Library v4 Component ver 23.1.1 in the binding project as the jar file had a dependency on that. Also I have ensured that all the Resource assets are included in the jar file.
When I use this library in an Android Sample like below,
var materialCalendar= new MaterialCalendarView(this);
this exception gets thrown
Failed resolution of: Lcom/prolificinteractive/materialcalendarview/R$drawable;
Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/prolificinteractive/materialcalendarview/R$drawable; ---> Java.Lang.ClassNotFoundException: Didn't find class "com.prolificinteractive.materialcalendarview.R$drawable" on path: DexPathList[[zip file "/data/app/com.fingent.materialcalendarsample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.fingent.materialcalendarsample-1/lib/x86, /vendor/lib, /system/lib]]
at --- End of managed exception stack trace ---
at java.lang.ClassNotFoundException: Didn't find class "com.prolificinteractive.materialcalendarview.R$drawable" on path: DexPathList[[zip file "/data/app/com.fingent.materialcalendarsample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.fingent.materialcalendarsample-1/lib/x86, /vendor/lib, /system/lib]]
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at at com.prolificinteractive.materialcalendarview.MaterialCalendarView.setupChildren(MaterialCalendarView.java:358)
at at com.prolificinteractive.materialcalendarview.MaterialCalendarView.<init>(MaterialCalendarView.java:237)
at at com.prolificinteractive.materialcalendarview.MaterialCalendarView.<init>(MaterialCalendarView.java:216)
at at md56fd5622393123d59c6c51d78708f2ed2.MainActivity.n_onCreate(Native Method)
at at md56fd5622393123d59c6c51d78708f2ed2.MainActivity.onCreate(MainActivity.java:28)
at at android.app.Activity.performCreate(Activity.java:5990)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at at android.app.ActivityThread.access$800(ActivityThread.java:151)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at at android.os.Handler.dispatchMessage(Handler.java:102)
at at android.os.Looper.loop(Looper.java:135)
at at android.app.ActivityThread.main(ActivityThread.java:5254)
at at java.lang.reflect.Method.invoke(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:372)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
at Suppressed: java.lang.ClassNotFoundException: com.prolificinteractive.materialcalendarview.R$drawable
at at java.lang.Class.classForName(Native Method)
at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
at ... 19 more
at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
--- End of inner exception stack trace ---
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
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00084] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1029
at Android.Runtime.JNIEnv.FinishCreateInstance (IntPtr instance, IntPtr jclass, IntPtr constructorId, Android.Runtime.JValue* constructorParameters) [0x0000b] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:306
at MaterialCalendarLibrary.MaterialCalendarView..ctor (Android.Content.Context p0) [0x000c5] in /Users/fingent/Projects/MaterialCalendarLibrary/MaterialCalendarLibrary/obj/Release/generated/src/MaterialCalendarLibrary.MaterialCalendarView.cs:505
at MaterialCalendarSample.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00009] in /Users/fingent/Documents/sreeraj/workspace/Xamarin.MaterialCalendarView/MaterialCalendarSample/MainActivity.cs:17
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2475
at at (wrapper dynamic-method) System.Object:0b8c341c-2f19-42d5-83e9-b3a815827e69 (intptr,intptr,intptr)
at --- End of managed exception stack trace ---
at java.lang.NoClassDefFoundError: Failed resolution of: Lcom/prolificinteractive/materialcalendarview/R$drawable;
at at com.prolificinteractive.materialcalendarview.MaterialCalendarView.setupChildren(MaterialCalendarView.java:358)
at at com.prolificinteractive.materialcalendarview.MaterialCalendarView.<init>(MaterialCalendarView.java:237)
at at com.prolificinteractive.materialcalendarview.MaterialCalendarView.<init>(MaterialCalendarView.java:216)
at at md56fd5622393123d59c6c51d78708f2ed2.MainActivity.n_onCreate(Native Method)
at at md56fd5622393123d59c6c51d78708f2ed2.MainActivity.onCreate(MainActivity.java:28)
at at android.app.Activity.performCreate(Activity.java:5990)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at at android.app.ActivityThread.access$800(ActivityThread.java:151)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at at android.os.Handler.dispatchMessage(Handler.java:102)
at at android.os.Looper.loop(Looper.java:135)
at at android.app.ActivityThread.main(ActivityThread.java:5254)
at at java.lang.reflect.Method.invoke(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:372)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
at Caused by: java.lang.ClassNotFoundException: Didn't find class "com.prolificinteractive.materialcalendarview.R$drawable" on path: DexPathList[[zip file "/data/app/com.fingent.materialcalendarsample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.fingent.materialcalendarsample-1/lib/x86, /vendor/lib, /system/lib]]
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at ... 18 more
at Suppressed: java.lang.ClassNotFoundException: com.prolificinteractive.materialcalendarview.R$drawable
at at java.lang.Class.classForName(Native Method)
at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
at ... 19 more
at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Here is the link to the project in Github Xamarin Material CalendarView
It's about missing Resources that should be attached in Material CalendarView, you need an AAR file.
Just go Maven and get latest AAR file that published by Author: http://mvnrepository.com/artifact/com.prolificinteractive/material-calendarview/1.2.0
Remove the material-calendarview.jar and drag new file material-calendarview-1.2.0.aar on your binding project, done!
A Drawable is a graphic resource and the Java exception is on the following line (from the lib your binding):
buttonPast.setImageResource(R.drawable.mcv_action_previous);
So you are missing mcv_action_previous which a PNG-based arrow located in the res/drawable-xxxhdpi/mcv_action_previous.png within the project that you are binding.
Are all the resources included? Any of your binding transformations or binding warning about resources?
Using Xamarin XS v5.5, AutoMapper v3.2.1,
I get this runtime error in Release build (not in Debug):
This type is not supported on this platform INullableConverterFactory
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException:
An exception was thrown by the type initializer for AutoMapper.Mappers.MapperRegistry --->
System.TypeInitializationException:
An exception was thrown by the type initializer for AutoMapper.Mappers.EnumMapper --->
System.PlatformNotSupportedException: This type is not supported on this platform INullableConverterFactory
[mono-rt] at AutoMapper.Internal.PlatformAdapter.Resolve[INullableConverterFactory] (Boolean throwIfNotFound) [0x00000] in <filename unknown>:0
[mono-rt] at AutoMapper.Mappers.EnumMapper..cctor () [0x00000] in <filename unknown>:0
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at AutoMapper.Mappers.MapperRegistry..cctor () [0x00000] in <filename unknown>:0
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at AutoMapper.Mapper.Reset () [0x00000] in <filename unknown>:0
[mono-rt] at AutoMapper.Mapper.Initialize (System.Action`1 action) [0x00000] in <filename unknown>:0
[mono-rt] at MyApp.Android.MainActivity.ConfigMapper () [0x00000] in <filename unknown>:0
[mono-rt] at MyApp.Android.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0
[mono-rt] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00000] in <filename unknown>:0
[mono-rt] at (wrapper dynamic-method) object:3cc570cf-1f33-4513-b6e4-0e910820d0ba (intptr,intptr,intptr)
What could the issue be?
It's most likely the linker removing that type from the AutoMapper assembly..
Usually RELEASE mode has the linker set to SDK Assemblies or ALL Assemblies where as DEBUG doesn't do any linking
Check here how to modify what's linked
https://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/
I had the same exception and adding this fellow in fixed it
<assembly fullname="AutoMapper">
<type fullname="*INullableConverterFactory*" />
<type fullname="*MappingExpression*" />
</assembly>