Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Java.Lang.NoClassDefFoundError after executing a blank Xamarin.Forms Android project

When creating a new Xamarin.Forms Shared app and execute the Android app, it will throw me a Java.Lang.NoClassDefFoundError at MainActivity#OnCreate:22. The exception details specify android.animation.ValueAnimator as the source and the following exception trace:

Java.Lang.NoClassDefFoundError: android.animation.ValueAnimator
at Android.Runtime.JNIEnv.FindClass (string) [0x00087] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:396
at Android.Runtime.JNIEnv.FindClass (string,intptr&) [0x00014] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:409
at Android.Animation.ValueAnimator.get_class_ref () [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Animation.ValueAnimator.cs:147
at Android.Animation.ValueAnimator..ctor () [0x00084] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Animation.ValueAnimator.cs:178
at at Xamarin.Forms.Platform.Android.AndroidTicker..ctor () <IL 0x00009, 0x0008f>
at at Xamarin.Forms.Forms.Init (Android.App.Activity,Android.OS.Bundle) <IL 0x00087, 0x00503>
at TestProject.Android.MainActivity.OnCreate (Android.OS.Bundle) [0x00009] in c:\Users\jeroen\Documents\Projects\TestProject\Android\MainActivity.cs:22
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:1943
at at (wrapper dynamic-method) object.62039a7e-6730-4dd0-91b9-db0d873378d4 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
at --- End of managed exception stack trace ---
at java.lang.NoClassDefFoundError: android.animation.ValueAnimator
at at Method)
at at
at at
at at
at at
at at$1500(
at at$H.handleMessage(
at at android.os.Handler.dispatchMessage(
at at android.os.Looper.loop(
at at
at at java.lang.reflect.Method.invokeNative(Native Method)
at at java.lang.reflect.Method.invoke(
at at$
at at
at at dalvik.system.NativeStart.main(Native Method)
at Caused by: java.lang.ClassNotFoundException: android.animation.ValueAnimator in loader dalvik.system.PathClassLoader[/data/app/TestProject.Android-1.apk]
at at dalvik.system.PathClassLoader.findClass(
at at java.lang.ClassLoader.loadClass(
at at java.lang.ClassLoader.loadClass(
at ... 15 more

This happens both in Xamarin Studio and Visual Studio and occurs both when I use and emulator and a physical device.

I have used API 10 at the emulators and my phone. SDK platforms L, 20, 19, 15, 12 and 10 are installed additonally to the Android Support Library, Google USB Driver, Android SDK tools, Android SDK Platform-Tools and Android SDK Build-Tools 20 & 17.

What could cause this?


  • jeroenvanneveljeroenvannevel BEMember

    Since I can't edit my post I'll add it here: this only occurs at Xamarin.Forms projects (both a Portable and a Shared app), a classic Android app runs just fine.

  • jeroenvanneveljeroenvannevel BEMember

    I figured I'd update this: it was a matter of phone. I switched my Samsung Galaxy Gio GTS-5660 for a Motorola Moto G and now everything works flawlessly.

Sign In or Register to comment.