-1

I try to implement google play services for the google cloud messaging. I tried to do this with developers.google, but i can not go futher. I get stuck by Set Up Google Play Services. I tried to compile com.google.android.gms:play-services:8.4.0 but I get this error message:

Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.

So i tried to compbile 8.3.0 and then i get a other error message:

Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_21\bin\java.exe'' finished with non-zero exit value 2

Can somebody help me out?

Nicholas
  • 1,676
  • 12
  • 35
user3432681
  • 564
  • 4
  • 10
  • 25
  • Good luck recovering your project. – Shark Feb 22 '16 at 14:54
  • Please provide the all the gradle settings related to the `com.google.android.**`. I think you have compiled two play-services plugin with different versions. – goofyz Feb 23 '16 at 02:18

2 Answers2

1

I can't help with the second error you had, but can hopefully help with the google services plugin error. In this answer, Lord Flash lists a few necessary elements to get the plugin to work correctly. Namely:

  1. Put this at the end of your apps build.gradle

    apply plugin: 'com.google.gms.google-services'
    
  2. Set your projects build.gradle dependencies to

    'classpath 'com.google.gms:google-services:2.0.0-beta5'
    

    (or whatever the newest version is)

  3. Set Gradle Version to 2.10 - this was the key step for me to get everything working.

    Android Studio: File > Project Structure > Project
    

Hope it works for you!

Community
  • 1
  • 1
ArkF
  • 129
  • 9
  • Welcome to Stack Overflow! Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Hatchet Feb 23 '16 at 01:02
  • Thanks for the info Hatchet, I edited the answer to be more helpful – ArkF Feb 23 '16 at 04:11
0

I get the answer from UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define

If you do not need all the google play services library dependencies STAY AWAY from this line in your build.gradle compile 'com.google.android.gms:play-services:8.3.0' and instead just use what you need!!

Community
  • 1
  • 1
user3432681
  • 564
  • 4
  • 10
  • 25