0

I am trying to integrate gcm. I have applied code and done all things instructed at https://developers.google.com/cloud-messaging/android/start. But when I run below code in terminal,

.\gradlew.bat run -Pmsg="<Hi>"

it gives

FAILURE: Build failed with an exception.
* What went wrong:
Task 'run' not found in root project 'myProject'.

  • Try: Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I am able to run .\gradlew task. I am trying to send upstream message from Android Studio to check wheather this gcm code is working or not.

build.gradle

apply plugin: 'com.android.application'

     android {
         signingConfigs {
             release {
                keyAlias 'myProject'
                 keyPassword 'myProject'
                 storeFile file('D:/Signed apk all projects/myProject/myProject.jks')
                 storePassword 'myProject'
             }
         }
         compileSdkVersion 23
         buildToolsVersion '23.0.3'
         defaultConfig {
             applicationId "com.myProject"
             minSdkVersion 16
             targetSdkVersion 23
             versionCode 4
             versionName "1.4"
             multiDexEnabled = true
         }
         buildTypes {
             debug {
                 minifyEnabled false
                 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                 debuggable true
             }
             debug {
                 debuggable true
             }
             release {
                 signingConfig signingConfigs.release
                 minifyEnabled false
                 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                 debuggable true
             }
         }
         sourceSets {
             main {
                 assets.srcDirs = ['src/main/assets', 'src/main/assets/']
                 jniLibs.srcDir 'libs'
                 jni.srcDirs = [] //disable automatic ndk-build call
             }
         }

         repositories {
             maven {
                 url "https://jitpack.io"
             }
         }
         dexOptions {
             javaMaxHeapSize "4g"
         } }

     dependencies {
         compile fileTree(dir: 'libs', include: ['*.jar'])
         compile 'com.google.android.gms:play-services-auth:8.4.0'
         compile 'com.google.android.gms:play-services-ads:8.4.0' }

     apply plugin: 'com.google.gms.google-services'
Tushar Sheth
  • 391
  • 4
  • 18

0 Answers0