0

I am well aware of the reasons behind app:dexDebug error in Android. Going through many similar question in stackoverflow and trying every possible solution, I finally traced out the cause of the error. Below are my dependencies:enter image description here

If the two compiles

compile 'com.google.android.gms:play-services:+'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'

are compiled together, the error is caused. Removing either of the compiles removes the error, but I don't understand why? Google Play is required for cloud messaging while Azure services is required for registering the device to the Azure push notification hub. I don't see any possibility that they share common jar files or have repeated/duplicate class anywhere.

The libs folder is empty.

Any suggestion for the problem?

adelphus
  • 10,116
  • 5
  • 36
  • 46
user3303274
  • 729
  • 2
  • 8
  • 21
  • If you want people to help you understand an error, it helps if you post the actual text of the error message - otherwise, we are just guessing. – adelphus Oct 19 '15 at 23:18
  • Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 2 ---- this is the error message that i have received – user3303274 Oct 20 '15 at 03:50

3 Answers3

2

There is no conflict of Google play service and azure mobile service compiles. I have a test project with dependencies: compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3' compile 'com.google.android.gms:play-services:+' And sync project with gradle files, it works fine on my side.

To integrate Notification Hubs in Azure Mobile Service, we can refer to official guide of Azure Notification Hubs which was updated at 10/15/2015. In this article, it uses gms dependency in: compile 'com.google.android.gms:play-services-base:6.5.87'

By the way, I found the a thread with the same issue you met, maybe it will give you some help.

Community
  • 1
  • 1
Gary Liu
  • 13,758
  • 1
  • 17
  • 32
  • Mate this is the exact thing required. Though late thank you for the response. I simply downloaded the "create new app" from azure and just copied the dependencies from the app's gradle to my own project and it worked :) May be this will hep to some one too. – user3303274 Oct 20 '15 at 09:40
0

Shouldn't you use a version number instead of the '+' ?

Try this:

compile 'com.google.android.gms:play-services:8.1.0'

Cause maybe the '+' is compiling the 2 import together....

Edit: What is exactly the error trace you have ?

Cukic0d
  • 5,111
  • 2
  • 19
  • 48
  • I tried, but still gives the same error. Beside, in my manifest.xml, i have This should automatically give the correct version of play services. – user3303274 Oct 19 '15 at 22:24
  • As in every app:dexDebug issues, i have `Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 2` error after the gradle biuild – user3303274 Oct 20 '15 at 06:15
0

Well, Actually both play service and azure service binaries have dependency loop. To solve this issue instead of using generic statement (i.e. 'com.google.android.gms:play-services:8.3.0' ) use precise one (i.e. for eg. 'com.google.android.gms:play-services-maps:8.3.0' ) which narrows the compilation area, hence reducing probability of conflicts. Hope this helps

Malik Khan
  • 74
  • 6