2015-06-17 37 views
11

Ho scaricato l'esempio dei servizi Google da here e quando provo a eseguirlo seguendo i passaggi relativi a JSON, viene visualizzato un errore. Il problema è che la console e il registro non mostrano nulla su questo errore.Google Cloud Messaging - esempio di servizi Google Gradle errore sconosciuto

Sembra così. enter image description here

mi hanno alcuna idea di cosa sto facendo male, ma, dopo questo, non posso provare a farlo funzionare di nuovo, perché il pulsante Run è disattivato.

Qualche idea per risolvere questo?

UPDATE: Questo è il registro nella console Gradle:

Configuration on demand is an incubating feature. 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE 
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library UP-TO-DATE 
:app:prepareDebugDependencies 
:app:compileDebugAidl UP-TO-DATE 
:app:compileDebugRenderscript UP-TO-DATE 
:app:generateDebugBuildConfig UP-TO-DATE 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets UP-TO-DATE 
:app:generateDebugResValues UP-TO-DATE 
:app:processDebugGoogleServices 
No matching client found for package name 'gcm.play.android.samples.com.gcmquickstart' 
:app:generateDebugResources 
:app:mergeDebugResources UP-TO-DATE 
:app:processDebugManifest UP-TO-DATE 
:app:processDebugResources UP-TO-DATE 
:app:generateDebugSources UP-TO-DATE 
:app:processDebugJavaRes UP-TO-DATE 
:app:compileDebugJavaWithJavac 
:app:compileDebugNdk UP-TO-DATE 
:app:compileDebugSources 
:app:preDexDebug 
:app:dexDebug 
AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar ","sources":[{}]} 


:app:validateDebugSigning 
:app:packageDebug 
:app:zipalignDebug 
:app:assembleDebug 

BUILD SUCCESSFUL 

Total time: 19.379 secs 
+0

Stai cercando di eseguire l'esempio su un simulatore o su un dispositivo? Se è un simulatore potrebbe essere simile a questo problema http://stackoverflow.com/a/27966767/1410370 –

+0

Se lo fai ./gradlew assembleDebug dal terminale lo fa con successo? –

+0

@kroikie Ho la linea -Xmx256m, ed è la stessa cosa ... con il comando, scarica un sacco di file, quindi crea senza errori. ma quando provo a eseguire l'app, l'errore viene mostrato di nuovo –

risposta

3

ero incontrato lo stesso problema.

Come lo risolvo è modificare il file "build.gradle (Progetto: gcm)".

nel file build.gradle (Progetto: GCM)

buildscript { 
... 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.0.0-alpha3' 
     classpath 'com.google.gms:google-services:1.3.0-beta1'// downgrade it version 
    } 
} 

Spero che questo avrebbe aiutato.

+0

Perché funziona? – JohnyTex

14

questo funziona per me:

In build.gradle (app) ho

applicationId "com.examples.Activities" 

e in google-services.json ho

"package_name": "com.examples" 

ho cambiato

"package_name": "com.examples" 

a

"package_name": "com.examples.Activities" 
Problemi correlati