Has anyone imported this sliding menu project https://github.com/jfeinstein10/SlidingMenu in their Monodroid application?
I've imported the jar file (com.slidingmenu.lib.slidingmenuactivity.jar) in a new JavaLibraryProject.
I've created a new activity which extends from from SlidingActivity.
My project builds without any errors, but at runtime I get this exception
Java.Lang.NoClassDefFoundError: com.slidingmenu.lib.R$layout
on
base.OnCreate(bundle)
public class MainActivity : SlidingActivity
{
public override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle); //The EXCEPTION is thrown here
SetContentView(Resource.Layout.activity_main);
}
public override void SetBehindContentView(int p0)
{
base.SetBehindContentView(p0);
}
}
Any ideas anyone? Thanks :)
EDIT
Ok. I've done a little modification:
I've added the "assets", "bin" and "res" folders to a ".zip" file which I've added in my AndroidJavaLibrary project.
It compiles fine, but now I get another error on the same line:
Android.Views.InflateException: Binary XML file line #2: Error inflating class com.slidingmenu.lib.SlidingMenu
You need to include the Jar in both your Java Binding Library and your Mono for Android application. Just add a folder called libs to your Mono for Android project and copy the Jar file into that. You need to then set the build action to AndroidJavaLibrary.
So your solution should look like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With