android gradle复制任务没有执行?

时间:2016-05-10 09:40:47

标签: android android-gradle build.gradle gradle-task

这是我的build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

buildscript {

  }

 repositories {

   android {
        signingConfigs {
     release_config {

     }
   }

compileSdkVersion 22
buildToolsVersion '22'

defaultConfig {
    applicationId "in.workindia.xxxxxxxxxxandroid"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 35
    versionName "3.3.0"
    signingConfig signingConfigs.release_config
}
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    /*While app is in debug mode disable crashlytics*/
    debug {
        versionNameSuffix "-DEBUG"
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

buildTypes.debug {
    it.buildConfigField 'String', 'BASE_URLS', DEBUG_URLS
    it.buildConfigField 'String', 'CLIENT_ID', SERVER_DEBUG_CLIENT_ID
}

buildTypes.release {
    it.buildConfigField 'String', 'BASE_URLS', BASE_URLS
    it.buildConfigField 'String', 'CLIENT_ID', SERVER_RELEASE_CLIENT_ID
}
}

afterEvaluate {
   processDebugGoogleServices.dependsOn switchToDebug
   processReleaseGoogleServices.dependsOn switchToRelease
 }

     task switchToDebug(type: Copy) {
          description = 'Switches to DEBUG google-services.json'
          from "src/debug_work"
          include "google-services.json"
          into "."
       }

  task switchToRelease(type: Copy) {
      description = 'Switches to RELEASE google-services.json'
      from "src/release_work"
      include "google-services.json"
      into "."
     }

   dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
       dependencies {
     debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
     releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
   }
    compile 'com.google.android.gms:play-services-gcm:8.3.0'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile 'com.google.android.gms:play-services-location:8.3.0'
}

这三个没有被执行为什么?
afterEvaluate
switchToDebug
switchToRelease
enter image description here 我做错了什么?

1 个答案:

答案 0 :(得分:0)

把它放在你的依赖

@media screen and (max-width:1210px) {
   .app-one { 
       /* app-one is green div */
      /*need to come to the BOTTOM. and width:100%;*/
   }
   .app-two {
     /* app-two is red div */
     /* need to come to the TOP. and width:100%; */
   }
}

确保以下行是app build.gradle 文件末尾的

    compile 'com.google.android.gms:play-services-gcm:8.3.0'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile 'com.google.android.gms:play-services-location:8.3.0'

完整的Gradle文件:

apply plugin: 'com.google.gms.google-services'