0

我知道已经有几篇关于这个问题的帖子,但我花了几天时间找出问题所在,但我仍然收到这个错误,但我遵循了网上找到的所有步骤。

我只是想将此 jar 添加到我的项目中:https ://github.com/jgilfelt/android-mapviewballoons/

我将它与其他jar(例如admob)一起放入libs文件夹...它编译,然后我可以启动与jar相关的MapActivity(代码来自上面的下载,所以这是原始代码),当我点击一个标记时地图,应用程序崩溃,这是我得到的:

08-27 14:07:45.872: E/InputEventReceiver(4206): Exception dispatching input event.
08-27 14:07:45.872: E/MessageQueue-JNI(4206): Exception in MessageQueue callback: handleReceiveCallback
08-27 14:07:45.880: E/MessageQueue-JNI(4206): java.lang.NoClassDefFoundError: com.readystatesoftware.mapviewballoons.R$layout
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.readystatesoftware.mapviewballoons.BalloonOverlayView.setupView(BalloonOverlayView.java:79)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.readystatesoftware.mapviewballoons.BalloonOverlayView.<init>(BalloonOverlayView.java:58)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay.createBalloonOverlayView(BalloonItemizedOverlay.java:151)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay.createAndDisplayBalloonOverlay(BalloonItemizedOverlay.java:284)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay.onTap(BalloonItemizedOverlay.java:126)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:356)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.google.android.maps.MapView.onTouchEvent(MapView.java:683)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.readystatesoftware.maps.TapControlledMapView.onTouchEvent(TapControlledMapView.java:62)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.View.dispatchTouchEvent(View.java:7127)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2170)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1905)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1925)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1379)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.app.Activity.dispatchTouchEvent(Activity.java:2396)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1873)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.View.dispatchPointerEvent(View.java:7307)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3172)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3117)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4153)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4132)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4224)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.os.MessageQueue.nativePollOnce(Native Method)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.os.MessageQueue.next(MessageQueue.java:125)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.os.Looper.loop(Looper.java:124)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at android.app.ActivityThread.main(ActivityThread.java:4745)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at java.lang.reflect.Method.invokeNative(Native Method)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at java.lang.reflect.Method.invoke(Method.java:511)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-27 14:07:45.880: E/MessageQueue-JNI(4206):   at dalvik.system.NativeStart.main(Native Method)
08-27 14:07:45.880: W/dalvikvm(4206): threadid=1: thread exiting with uncaught exception (group=0x41fbb300)
08-27 14:07:45.887: E/AndroidRuntime(4206): FATAL EXCEPTION: main
08-27 14:07:45.887: E/AndroidRuntime(4206): java.lang.NoClassDefFoundError: com.readystatesoftware.mapviewballoons.R$layout
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.readystatesoftware.mapviewballoons.BalloonOverlayView.setupView(BalloonOverlayView.java:79)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.readystatesoftware.mapviewballoons.BalloonOverlayView.<init>(BalloonOverlayView.java:58)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay.createBalloonOverlayView(BalloonItemizedOverlay.java:151)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay.createAndDisplayBalloonOverlay(BalloonItemizedOverlay.java:284)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay.onTap(BalloonItemizedOverlay.java:126)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:356)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:683)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.readystatesoftware.maps.TapControlledMapView.onTouchEvent(TapControlledMapView.java:62)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.View.dispatchTouchEvent(View.java:7127)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2170)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1905)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1925)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1379)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.app.Activity.dispatchTouchEvent(Activity.java:2396)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1873)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.View.dispatchPointerEvent(View.java:7307)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3172)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3117)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4153)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4132)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4224)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.os.MessageQueue.nativePollOnce(Native Method)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.os.MessageQueue.next(MessageQueue.java:125)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.os.Looper.loop(Looper.java:124)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at android.app.ActivityThread.main(ActivityThread.java:4745)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at java.lang.reflect.Method.invokeNative(Native Method)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at java.lang.reflect.Method.invoke(Method.java:511)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-27 14:07:45.887: E/AndroidRuntime(4206):     at dalvik.system.NativeStart.main(Native Method)

我希望有人能帮助我。

4

1 回答 1

1
  1. 将 jar 文件作为项目导入您的工作空间。
  2. 从您的项目属性中,将导入的项目引用为库项目。
  3. 编译你的项目。
于 2012-08-27T12:33:40.340 回答