我更新爲使用Android Studio 2.2和Gradle 2.2.0。現在我有一個問題的建設。無法獲取未知媒體資源'processReleaseGoogleServices'
我跟着這篇文章https://medium.com/google-cloud/automatic-per-variant-google-services-json-configurations-with-gradle-d3d3e40abc0e#.g1p7c1tx2配置了兩個「google-services.json」文件用於dev和prod構建,並在我的app/build.gradle文件中使用以下方法在兩個「google -services.json「文件。
afterEvaluate {
processDebugGoogleServices.dependsOn switchToDebug
processReleaseGoogleServices.dependsOn switchToRelease
}
task switchToDebug(type: Copy) {
description = 'Switches to DEBUG google-services.json'
from "src/gcm-dev"
include "google-services.json"
into "."
}
task switchToRelease(type: Copy) {
description = 'Switches to RELEASE google-services.json'
from "src/gcm-prod"
include "google-services.json"
into "."
}
搖籃符合罰款,但是當我點擊「運行程序」(三角「播放」圖標)或「調試應用程序」 Android Studio中(三角形的一個錯誤「播放」圖標後面)按鈕,我得到如下:
* What went wrong:
A problem occurred configuring project ':app'.
> Could not get unknown property 'processReleaseGoogleServices' for object of type com.android.build.gradle.AppExtension.
請大家幫忙,非常感謝。
我在更新到Android Studio 2.2後得到了同樣的問題 – Paul
我更新Android Studio 2.2後出現同樣的問題 – sonida
您是否找到解決方案? – sofi37