Search code examples
androidbackendgoogle-cloud-endpoints

Could not set unknown property 'httpAddress' for object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension


I have the following code in build.gradle file.

   buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.3'
    }
  }

 repositories {
    jcenter()
 }
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.google.cloud.tools.appengine'
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

 dependencies {
    implementation 'com.google.endpoints:endpoints-framework:2.0.9'
    implementation 'javax.inject:javax.inject:1'

    implementation 'javax.servlet:servlet-api:2.5'
    implementation 'com.google.api-client:google-api-client:1.23.0'
    implementation 'com.google.http-client:google-http-client-android:1.23.0'

}
appengine {
    httpAddress = "0.0.0.0"
}

I have my backend for my Android App and I wanted to test it using a physical device. As per this guide, I added

appengine {
httpAddress = "0.0.0.0"
}

But I get the following error

Could not set unknown property 'httpAddress' for object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension.

How to resolve this error?


Solution

  • According to the official documentation, you want this:

    appengine {
      run {
        host = '0.0.0.0'
      }
    }
    

    or

    appengine.run.host = '0.0.0.0'