无法为 com.google.cloud.tools.gradle.appengine.core.AppEngineExtension 类型的对象设置未知 属性 'httpAddress'

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

我在 build.gradle 文件中有以下代码。

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

我有我的 Android 应用程序的后端,我想使用物理设备对其进行测试。根据这个guide,我添加了

appengine {
httpAddress = "0.0.0.0"
}

但是我得到以下错误

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

如何解决这个错误?

根据 the official documentation,你想要这个:

appengine {
  run {
    host = '0.0.0.0'
  }
}

appengine.run.host = '0.0.0.0'