Xamarin绑定Java库问题

时间:2014-08-22 08:50:05

标签: android binding jar xamarin inflate

1,我想将java库(https://code.google.com/p/android-wheel/)绑定到xamarin c#for android(IDE:VS2012 \ Eclipse)

2,这样的Bingding方法(http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)/

3,如果我在C#(。cs)中使用java代码,通常是

kankan.wheel.widget.WheelView wv = new kankan.wheel.widget.WheelView();
wv.DoSomething();

4,如果我使用布局中的视图(.axml),则抛出异常

    <kankan.wheel.widget.WheelView
    android:id="@+id/MyWheel"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_centerInParent="true" />


ex

{Android.Views.InflateException:抛出了'Android.Views.InflateException'类型的异常。   在Android.Runtime.JNIEnv.CallNonvirtualVoidMethod(IntPtr jobject,IntPtr jclass,IntPtr jmethod,Android.Runtime.JValue [] parms)[0x00084] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/ 163212a9 /源极/ MonoDroid的/ SRC / Mono.Android / SRC /运行时间/ JNIEnv.g.cs:895   位于/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android中的Android.App.Activity.SetContentView(Int32 layoutResID)[0x00070] -19 / SRC /生成/ Android.App.Activity.cs:4252   在app:.AdainActivity.OnCreate(Android.OS.Bundle包)[0x0000a]在c:\ Users \ zhengys.KGHGROUP \ Documents \ Visual Studio 2012 \ Projects \ App5 \ App5 \ MainActivity.cs:23   ---托管异常堆栈跟踪结束--- android.view.InflateException:二进制XML文件行#1:错误膨胀类kankan.wheel.widget.WheelView     在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)     在android.view.LayoutInflater.rInflate(LayoutInflater.java:746)     在android.view.LayoutInflater.inflate(LayoutInflater.java:489)     在android.view.LayoutInflater.inflate(LayoutInflater.java:396)     在android.view.LayoutInflater.inflate(LayoutInflater.java:352)     在com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)     在android.app.Activity.setContentView(Activity.java:1881)     在app5.MainActivity.n_onCreate(原生方法)     在app5.MainActivity.onCreate(MainActivity.java:28)     在android.app.Activity.performCreate(Activity.java:5104)     在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)     在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)     在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)     在android.app.ActivityThread.access $ 600(ActivityThread.java:141)     在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1234)     在android.os.Handler.dispatchMessage(Handler.java:99)     在android.os.Looper.loop(Looper.java:137)     在android.app.ActivityThread.main(ActivityThread.java:5041)     at java.lang.reflect.Method.invokeNative(Native Method)     在java.lang.reflect.Method.invoke(Method.java:511)     在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:793)     在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)     at dalvik.system.NativeStart.main(Native Method) 引起:java.lang.ClassNotFoundException:在路径上找不到类“kankan.wheel.widget.WheelView”:/ data /app / App5.App5-1.apk     在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)     在java.lang.ClassLoader.loadClass(ClassLoader.java:461)     在android.view.LayoutInflater.createView(LayoutInflater.java:552)     在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)     ......还有22个 }     base:{Java.Lang.RuntimeException}

5,有谁知道发生了什么?“kankan.wheel.widget.WheelView”错误的路径?什么是正确的?我需要你的帮助! 谢谢!!

0 个答案:

没有答案