Upgraded to SDK version 17, now libraries don'

2019-05-30 08:43发布

问题:

So, I recently upgraded my Android SDK, and for some reason it seems to have broken Analytics. I'm getting the following error from LogCat, which seems to be key, but I can hardly imagine that they would have removed getInstance, so I'm at a bit of a loss. Any ideas?

Could not find method com.google.android.apps.analytics.GoogleAnalyticsTracker.getInstance, referenced from method 
03-22 06:30:44.341: W/dalvikvm(217): VFY: unable to resolve static method 117: Lcom/google/android/apps/analytics/GoogleAnalyticsTracker;.getInstance ()Lcom/google/android/apps/analytics/GoogleAnalyticsTracker;
03-22 06:30:44.341: W/dalvikvm(217): VFY:  rejecting opcode 0x71 at 0x005a

I've tried the following to resolve it:

  1. Remove the Analytics library, then put it back in.
  2. Perform a clean, then re-built the project.
  3. Remove the Analytics Library completely from my machine, then re-install it.
  4. Remove Eclipse plug-in and re-install.

None of this seems to work. I think what's happening is that the library isn't being included as a part of the ADK, but I'm not quite sure, so...

回答1:

It's a problem with libraries in ADT17.



回答2:

ADT 17 changes how libraries are dealt with. Unfortunately, it doesn't handle this automatically when you upgrade, nor let you know before you try to run it. In order to fix this, you need to:

  1. Remove all things from the build path.
  2. Create a folder named libs.
  3. Place all of your library functions in this folder.

Do all of this, and your project should build fine.