2014-10-10 69 views
1

我已经经历了在stackoverflow中提到的所有解决方案。Android - Google Play Services - Lib依赖关系

的Android ADT & SDK工具版本:23.0.4 谷歌游戏服务:20版

  1. '谷歌播放服务-lib的' 库项目导入到工作区和库项目添加到主要项目。

enter image description here

  • 在 '谷歌播放服务-lib的' 库项目,谷歌播放services.jars是

    “ libs'文件夹,它反映在Android专用依赖项中。

  • enter image description here

  • 在主要项目中, '谷歌播放服务-lib的' libraray项目添加库项目从

    右键点击属性 - >点击Android - >添加 - >添加库项目。

  • 注:日食的所有清洁和重新启动的尝试了。

    任何人都有什么问题的依赖关系。谷歌驱动器类没有找到并获得以下错误。

    10-11 02:51:14.640: W/dalvikvm(22107): VFY: unable to resolve interface method 6146: Lcom/google/android/gms/drive/DriveFolder;.getDriveId()Lcom/google/android/gms/drive/DriveId; 
    10-11 02:51:14.640: D/dalvikvm(22107): VFY: replacing opcode 0x72 at 0x000f 
    10-11 02:51:14.645: D/AndroidRuntime(22107): Shutting down VM 
    10-11 02:51:14.645: W/dalvikvm(22107): threadid=1: thread exiting with uncaught exception (group=0x415262a0) 
    
    10-11 02:51:14.650: E/AndroidRuntime(22107): FATAL EXCEPTION: main 
        10-11 02:51:14.650: E/AndroidRuntime(22107): java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil 
        10-11 02:51:14.650: E/AndroidRuntime(22107): at com.ss.watsappcomedypic.MainActivity.onCreate(MainActivity.java:23) 
    

    控制台错误:

    Dx bad class file magic (cafebabe) or version (0033.0000) ...while parsing com/google/android/gms/common/internal/safeparcel/a.class ...while processing com/google/android/gms/common/internal/safeparcel/a.class 
    
    +0

    我很好奇。这是一个新项目吗?为什么你仍然在使用Eclipse? – dannyroa 2014-10-10 21:47:51

    +0

    向清单中的应用程序添加''。你会知道图书馆是否已经正确导入。 – Pr38y 2014-10-10 21:50:42

    +0

    我已经在android清单文件中添加了元数据。 – sowmia 2014-10-10 21:52:13

    回答

    1

    谷歌Play服务,20版需要JDK1.7或更高版本。

    Eclipse - Preferences - java - compiler - Compiler Compliance level - change from 1.6 to 1.7 
    
    +0

    +1。但是,在用1.7编译google-play-services后,由于GC超出内存限制错误,我无法再构建我的项目(使用播放服务)。你有什么经验吗? – kiruwka 2014-11-06 21:13:42

    +0

    http://stackoverflow.com/questions/20919229/can-not-run-project-after-adding-google-play-services-to-project – sowmia 2014-11-07 04:29:38

    +0

    当然试过。没有为我工作。切换到java 1.7后,你有同样的问题吗? – kiruwka 2014-11-07 07:55:38