Issue in achartengine jar file

自作多情 提交于 2019-12-01 06:28:08

问题


Actually i have created an app in which i have used achartengine to contruct graph. It was running ok, but today i saw an update for android SDK to r17.

Once i upadated the sdk the app i had build started crash. In the logcat i show the following error report. Why this happen, is it because the jar file i have used is deprecated.

03-27 14:44:26.320: E/AndroidRuntime(4360): java.lang.NoClassDefFoundError: [Lorg.achartengine.chart.PointStyle;
03-27 14:44:26.320: E/AndroidRuntime(4360):     at   in.com.example.ChartEngineActivity.onCreate(ChartEngineActivity.java:58)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.os.Looper.loop(Looper.java:130)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at android.app.ActivityThread.main(ActivityThread.java:3683)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at java.lang.reflect.Method.invokeNative(Native Method)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at java.lang.reflect.Method.invoke(Method.java:507)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-27 14:44:26.320: E/AndroidRuntime(4360):     at dalvik.system.NativeStart.main(Native Method)

回答1:


Here is your solution, just follow the steps from How to fix the “NoClassDefFoundError” with ADT 17 and you will be able to make it working.




回答2:


I just had a similar issue with ADT version 20 in Eclipse.

Why the error?

The demo project source and project are meant to be used with an earlier version of the ADT plugin.

Starting in either ADT 19 or 20, ADT began automatically setting up all of the JAR files that you place in the libs/ folder (note libs/, not lib/) as "Android Dependencies", rather than "Reference Libraries" (which you get when you right-click on a jar file and "Add to build path...".

Because of this change, the project file included with the AChartEngine sample project is outdated.

To use the sample code with ADT 20, take the following steps:

  1. Download and unzip the achartengine-1.0.0-demo-source.zip from the AChartEngine website. (Which is back up after suffering a catastrophic server breakdown, so kudos to them)
  2. Delete the .project and .classpath from the achartengine-1.0.0-demo
  3. In Eclipse, go to File>New...>Project...>Android Project from Existing Code
  4. Select "Browse..", and navigate to the directory that you unzipped the demo code to.
  5. Select "Copy project into workspace" (not strictly necessary, but the easiest)
  6. Select Finish.

Now, plug in your device, boot up your emulator, and run it!

Also, if you select the green "Run" button on the toolbar, and it throws an error similar to "Could not find a previous configuration" (something like that, though the wording was more cryptic),

  1. Click on the project in the package explorer
  2. Click the black down arrow next to the "Run" button
  3. Mouse over to "Run as", and select "Android Application"

Enjoy the charts!




回答3:


In ADT version 18: - Right click on project and go to "Build Path" -> "Configure Build Path". In tab "Order and Export" simply select all, but deselect only android.jar. Click OK and your project is ready to go.



来源:https://stackoverflow.com/questions/9886634/issue-in-achartengine-jar-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!