1

Clone the project https://github.com/googlesamples/google-services/tree/master/android/gcm and everything works perfectly.

When I try to add the module "App Engine Backend with Google Cloud Messaging" with the wizard I get the following error:

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

Now I try to add this in my build.gradle defaultConfig

multiDexEnabled true 

and clean the project and recompile. But I always get the same error. Finally I try to delete the form from the project (thinking to resume normal functioning) but I get the following error:

    Installing gcm.play.android.samples.com.gcmquickstart
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/gcm.play.android.samples.com.gcmquickstart"
    pkg: /data/local/tmp/gcm.play.android.samples.com.gcmquickstart
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.example.gcm.permission.C2D_MESSAGE pkg=it.elipse.tnttrackingapp]


DEVICE SHELL COMMAND: pm uninstall gcm.play.android.samples.com.gcmquickstart
DELETE_FAILED_INTERNAL_ERROR

Could someone help me? to you taking the same steps you find yourself in my situation? Thank you in advance

1 Answers1

0

SOLVED

Hi guys i've found by myself the answer. I hope that it can be helpfull for someone with the same problem. When Android Studio generates the backend module, adds this line at the end of dependencies of your build.gradle(Module:app)

compile project(path: ':backend', configuration: 'android-endpoints')

And you have something like this :

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:palette-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile project(path: ':backend', configuration: 'android-endpoints')

}

The workaround is to move the auto-generated line on the top of dependecies declaration, like this:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile project(path: ':backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:palette-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'  
compile 'com.android.support:support-v4:23.0.1'  
compile 'com.google.android.gms:play-services-gcm:8.1.0'

}

UPDATE

If you do not solve try:

Build->Make Project
Build->Make Module 'app'
Build->Clean Project
Build->Rebuild Project
  • Hey man i got same problem as urs but ur solution didn't work for me i didn't added aby library i just modified some classes do u have any idea how to solve this ? – Antwan Dec 04 '15 at 18:43
  • Which classes have you edit? Try to post your gradle file for try to solve it together – Federico Ponti Dec 04 '15 at 20:56
  • Thanks @Federico for ur response i have posted a question here kindly check it http://stackoverflow.com/questions/34068676/transformexception-errorexecution-failed-for-task-apptransformclasseswithd – Antwan Dec 04 '15 at 23:32
  • Tried both but no luck.... =( it worked earlier this year but now it's a problem. – Micro Dec 29 '15 at 22:47
  • MicroR have you seen my update? Try to post your code – Federico Ponti Dec 29 '15 at 22:50