Could not get unknown property 'processReleaseGoogleServices'

could not get unknown property 'version_name for project
could not get unknown property 'assemble' for task
could not get unknown property 'versionnumber' for settings 'android'
could not get unknown property gradle task
could not get unknown property 'android
error: could not get unknown property 'com' for root project
could not get unknown property roomversion
could not get unknown property sdk for project

I updated to use Android Studio 2.2 and Gradle 2.2.0. And now I have a problem building.

I followed this post https://medium.com/google-cloud/automatic-per-variant-google-services-json-configurations-with-gradle-d3d3e40abc0e#.g1p7c1tx2 to configure two "google-services.json" files to be used for dev vs prod builds and use the following method in my app/build.gradle file to toggle between the copying the two "google-services.json" files.

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 "."
}

Gradle complies fine but when I click on the "Run app" (triangle "play" icon) or "Debug app" (triangle "play" icon with a bug behind) buttons in Android Studio, I get the following:

* What went wrong:
A problem occurred configuring project ':app'.
> Could not get unknown property 'processReleaseGoogleServices' for object of type com.android.build.gradle.AppExtension.

Please help, much appreciated.

I had the same issue and problem was in enabled instant run.Try to disable it and run again.

Gradle Build Error Could not get unknown property supportVersion , The error tells that there is no value for the variable $supportVersion. If you know exactly what version you would like to use then define  After updating Android Studio to version 2.2 and the gradle plugin to 2.2.0, I get following error: Error:(32, 1) A problem occurred evaluating project ':jobdispatcher'. Could not get unknown property 'assembleRelease' for project ':jobdispatcher' of type org.gradle.api.Project.

You should update Google Play Services gradle plugin as well, follow the documentation to set it up: https://developers.google.com/android/guides/google-services-plugin

The great thing is that you no longer need to write gradle tasks which create appropriate google-services.json files in your root directory. Build type specific google-services.json are now supported by the plugin:

"As of version 2.2.0 the plugin supports build type and product flavor specific JSON files. All of the following directory structures are valid"

Android Example Doesn't Build: Could not get unknown property , Failed to notify project evaluation listener. > Could not get unknown property '​assembleRelease' for root project 'android' of type org.gradle.api. Android Studio: “Could not get unknown property 'com' for root project 'watchface-master' of type org.gradle.api.Project.” Hot Network Questions What is "=" in transcriptions of Hittite

An alternative way to this is to refer to the task in the following way:

tasks.whenTaskAdded { task ->
    if (task.name == 'assembleDebug') {
        task.dependsOn 'switchToDebug'
    } else if (task.name == 'assembleRelease') {
        task.dependsOn 'switchToRelease'
    }
}

UPDATE

The problem you mentioned in comment is related to your google-services.json file. You need to place google-services.json into app/ dir. And for each build type there should be accordant director in app/src folder. If file already exists check if correct package name inside it

"client_info": {
"mobilesdk_app_id": "1:6596814400689:android:65d6f25f5006145",
"android_client_info": {
  "package_name": "com.my.app.package.name"
}

Could not get unknown property 'VersionNumber' · Issue #1263 , gradle' line: 114 * What went wrong: A problem occurred evaluating root project '​nativescript_plugin_firebase'. > Could not get unknown property  Could not get unknown property 'org' for project ':library' of type org.gradle.api.Project. #483. yizems opened this issue Jul 1, 2019 · 2 comments Comments.

As described by @Singed, add a directory pr build type/flavor under src-directory and the corresponding google-services.jsonand Google Play gradle plugin will take care of the rest, e.g.:

src/
    debug/google-services.json
    release/google-services.json

During build the correct file will be processed, ending up in build/generated/res/google-services/debug|release/values/values.xml

Could not get unknown property in Android, Hi Community, I want to use Bitrise for my Android application, but I have the following error: * What went wrong: A problem occurred evaluating  Could not run build action using Gradle distribution: Could not get unknown property #947. behrangsa opened this issue Jun 11, 2019 · 2 comments Comments.

React Native Notes 17: Could not get unknown property , React Native Notes 17: Could not get unknown property '​mergeResourcesProvider' for object of type com.android.build.gradle.internal.api. Gradle: Could not get unknown property 'classesDir' for main classes. Ask Question Asked 1 year, 2 months ago. Active 6 months ago. Viewed 7k times 7. According to

Gradle build failed : "Could not get unknown property 'GradleVersion , Gradle build failed : "Could not get unknown property 'GradleVersion' ". So I was trying to build my project and I keep getting the same error  Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl. #4757 hadnet opened this issue Feb 19, 2019 · 41 comments Comments

Followed and I got this `Could not get unknown property 'preBuild , Followed and I got this `Could not get unknown property 'preBuild' for project ':​app' of type…” is published by Chip Cerio. Could not get unknown property 'implementation' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

Comments
  • I got same question after update to Android Studio 2.2
  • I just got the same problem after I update Android Studio 2.2
  • Did you find solution?
  • doesn't work - I get the following: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseGoogleServices'. > No matching client found for package name
  • @user1465656 check my update please. Problem is related to google-services.json