将AChartEngine 1.0.0绑定到Mono For Android项目不起作用

时间:2012-12-10 18:12:44

标签: android mono xamarin.android achartengine

是否有人能够将achartengine 1.0库绑定到MonoForAndroid项目(rel.4.2.7)并使其有效?

我在我的解决方案中创建了“Java绑定库”项目,我已将文件acahrtengine.jar复制到Jars文件夹中,编辑了文件Transforms / metadata.xml,添加了以下行以规范化命名空间并修复一个错误:

<attr path="/api/package[@name='org.achartengine']" name="managedName">AChartEngine</attr>
<attr path="/api/package[@name='org.achartengine.chart']" name="managedName">AChartEngine.Chart</attr>
<attr path="/api/package[@name='org.achartengine.model']" name="managedName">AChartEngine.Model</attr>
<attr path="/api/package[@name='org.achartengine.renderer']" name="managedName">AChartEngine.Renderer</attr>
<attr path="/api/package[@name='org.achartengine.tools']" name="managedName">AChartEngine.Tools</attr>
<attr path="/api/package[@name='org.achartengine.util']" name="managedName">AChartEngine.Util</attr>

<attr path="/api/package[@name='org.achartengine.tools']/class[@name='Pan']/method[@name='addPanListener']" name="eventName">PanEvent</attr>

它符合顺序没有错误并创建DLL,但当我添加对我的项目的引用,我尝试重新编译我有以下错误

obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error :      org.achartengine.tools.PanListener
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error : 
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error :         org.achartengine.tools.ZoomListener
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error : 
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error :    public void zoomApplied (org.achartengine.tools.ZoomEvent p0)
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error : 
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(33,59): error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(33,59): error :  private native void n_zoomApplied (org.achartengine.tools.ZoomEvent p0);

任何使AChartEngine适用于Mono For Android的建议? 谢谢

1 个答案:

答案 0 :(得分:1)

您需要将jar文件添加到Monodroid项目以及引用绑定项目。

此过程在此处的帮助文档中进行了描述:

http://docs.xamarin.com/Android/Guides/Advanced_Topics/Java_Integration_Overview/Binding_a_Java_Library_(.jar)#Add_the_Jar_to_the_Project