Task 'run' not found in root project 'myProject'
<p>I am trying to integrate gcm. I have applied code and done all things instructed at <a href="https://developers.google.com/cloud-messaging/android/start" rel="nofollow">https://developers.google.com/cloud-messaging/android/start</a>. But when I run below code in terminal,</p>

<pre><code>.\gradlew.bat run -Pmsg="&lt;Hi&gt;"
</code></pre>

<p>it gives </p>

<blockquote>
  <p>FAILURE: Build failed with an exception.<br>
  * What went wrong:<br>
  Task 'run' not found in root project 'myProject'.</p>
  
  <ul>
  <li>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.</li>
  </ul>
</blockquote>

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

<p>build.gradle</p>

<pre><code>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'
</code></pre>