【问题标题】:Could not find class 'com.google.android.gms.analytics.Tracker' after ADT updateADT 更新后找不到类“com.google.android.gms.analytics.Tracker”
【发布时间】:2015-01-27 05:54:09
【问题描述】:

我已将 ADT 更新到 v23.0.5,而在之前工作的项目中,Google Analytics 无法正常工作。 logcat 上的确切错误是:

 VFY: unable to find class referenced in signature (Lcom/google/android/gms/analytics/Tracker;)
 Could not find class 'com.google.android.gms.analytics.Tracker', referenced from method com.mypackage.myApp.getTracker
 VFY: unable to resolve check-cast 587 (Lcom/google/android/gms/analytics/Tracker;) in Lcom/myApp/MyApplication;

以前,我也使用 Google Analytics v4。我查了一堆答案,比如123

总结一下,我做/检查:

  • 我使用 Eclipse,由于我使用了一些 Eclipse 插件,无法迁移到 Android Studio。
  • 我的项目和 google-play-services_lib 是通过 Import/'Existing Android code into workspace' 导入的,并且还选中了'Copy prijects into workspace'
  • 库项目已添加
  • 我也查了project.properties,相关文件内容好像没问题:android.library.reference.1=../google-play-services_lib,我打不开proguard
  • 没有编译错误
  • 在项目属性中,Java 构建路径/顺序和导出:Android 私有库和 Android 依赖项均已检查
  • 清理后,我的项目bin/dexedLibs 包含以下文件:
    • android-support-v4-*
    • androidplot-core-0.6.1-*(来自项目/库)
    • google-play-services_lib-*
    • google-play-services-*
    • gson-2.2.4-*(来自项目/库)

有人知道我想念什么吗? 提前致谢。

【问题讨论】:

    标签: java android eclipse google-analytics classnotfoundexception


    【解决方案1】:

    就我而言,我重新安装了整个 ADT(真可惜),最后它开始工作了。唯一的区别在于我的 .classpath 文件(条目顺序):

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    -    <classpathentry kind="src" path="src"/>
    -    <classpathentry kind="src" path="gen"/>
         <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
         <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
         <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
         <classpathentry kind="src" path="src"/>
     +   <classpathentry kind="src" path="gen"/>
     +   <classpathentry kind="output" path="bin/classes"/>
    </classpath>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-12
      • 1970-01-01
      • 1970-01-01
      • 2013-06-02
      相关资源
      最近更新 更多