问题
I have an app that makes use of the Google Analytics library. I recently moved the code into a new workspace and the app has stopped working. The code builds OK but when it runs it halts with the following error.
06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getTracker, referenced from method com.apps4care.v2conf.utils.analytics.raiseEvent
06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7179: Lcom/google/analytics/tracking/android/EasyTracker;.getTracker ()Lcom/google/analytics/tracking/android/Tracker;
06-12 23:11:14.117: D/dalvikvm(31080): VFY: replacing opcode 0x71 at 0x0021
06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getInstance, referenced from method com.apps4care.v2conf.utils.analytics.start
06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7178: Lcom/google/analytics/tracking/android/EasyTracker;.getInstance ()Lcom/google/analytics/tracking/android/EasyTracker;
06-12 23:11:14.117: D/dalvikvm(31080): VFY: replacing opcode 0x71 at 0x0000
06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getInstance, referenced from method com.apps4care.v2conf.utils.analytics.stop
06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7178: Lcom/google/analytics/tracking/android/EasyTracker;.getInstance ()Lcom/google/analytics/tracking/android/EasyTracker;
The analytics JAR is in my "libs" folder and I can see it listed in the "Libraries" tab on the Java Build Path within Properties.
Any clues how I can fix this....
回答1:
I'm assuming you're in Eclipse.
Right click on your project, select Properties.
Under Java Build Path, click on Order & Export tab.
Check Android Private Libraries and click OK.
来源:https://stackoverflow.com/questions/17076446/android-could-not-find-method-com-google-analytics-tracking-android-easytracke