无法找到com.google.analytics.tracking.android.EasyTracker.getInstance方法

时间:2013-10-26 15:47:10

标签: java android google-analytics

我正在尝试将Google Analitics集成到Android中,但我有一些疑问和问题。

1.-使用EasyTracker Jar需要libGoogleAnalyticsServices.jar吗?

2.-我遵循了本指南

https://developers.google.com/analytics/devguides/collection/android/v3/?hl=es#analytics-xml

我的构建中有Easytracker.jar,但它会抛出此错误。

这是我下载的easytracker - >

http://code.google.com/p/analytics-api-samples/downloads/detail?name=EasyTrackerAndroid_1.0.zip&can=2&q=

10-26 17:44:45.411: I/dalvikvm(2972): Could not find method com.google.analytics.tracking.android.EasyTracker.getInstance, referenced from method com.androidexample.uploadtoserver.Splash.onStart
10-26 17:44:45.411: W/dalvikvm(2972): VFY: unable to resolve static method 3570: Lcom/google/analytics/tracking/android/EasyTracker;.getInstance (Landroid/content/Context;)Lcom/google/analytics/tracking/android/EasyTracker;
10-26 17:44:45.421: D/dalvikvm(2972): VFY: replacing opcode 0x71 at 0x0003
10-26 17:44:45.421: I/dalvikvm(2972): Could not find method com.google.analytics.tracking.android.EasyTracker.getInstance, referenced from method com.androidexample.uploadtoserver.Splash.onStop
10-26 17:44:45.421: W/dalvikvm(2972): VFY: unable to resolve static method 3570: Lcom/google/analytics/tracking/android/EasyTracker;.getInstance (Landroid/content/Context;)Lcom/google/analytics/tracking/android/EasyTracker;
10-26 17:44:45.421: D/dalvikvm(2972): VFY: replacing opcode 0x71 at 0x0003
10-26 17:44:45.431: I/BugSenseHandler(2972): Registering default exceptions handler
10-26 17:44:45.526: D/dalvikvm(2972): GC_FOR_ALLOC freed 132K, 4% free 13772K/14211K, paused 29ms
10-26 17:44:45.531: I/dalvikvm-heap(2972): Grow heap (frag case) to 15.155MB for 1536016-byte allocation
10-26 17:44:45.566: D/dalvikvm(2972): GC_FOR_ALLOC freed <1K, 4% free 15271K/15751K, paused 14ms

1 个答案:

答案 0 :(得分:0)

  1. 在Eclipse中,右键单击您的项目,选择“属性”。
  2. 在Java Build Path下,点击Order&amp;导出选项卡。检查Android私密 库,然后单击“确定”。
  3. 清理项目并重建它。 它应该现在可以工作。