【问题标题】:Where do I specify the appIdproperty that gradle is asking for?我在哪里指定 gradle 要求的 appIdproperty?
【发布时间】:2014-06-07 11:47:36
【问题描述】:

我正在开发一个使用 appengine 作为其后端的应用程序。我想使用 gradle 的命令行为我的应用下载后端服务器端代码。

我在命令提示符下键入 gradlew appengineDownloadApp ,这就是我得到的

FAILURE:构建失败并出现异常。

  • 出了什么问题: 发现任务 ':app_server:appengineDownloadApp' 的配置有问题。 没有为属性“appId”指定值。

在哪里输入 appId?我假设这是我的 appengine 帐户中的项目 ID,但我不确定将这个值粘贴到哪里以便 gradle 读取它。

【问题讨论】:

  • 我通过从 github 下载移动后端启动器 appengine 应用程序的服务器端代码解决了我的问题,并按照我想要的方式对其进行了调整,然后将其上传。我现在可以随意调整它,并使用 gradle 的出色插件工具随时更新它!
  • jamrockRay - 你能提供更多细节吗?如果这可行,那么作为解决方案而不是评论会更有帮助。

标签: android google-app-engine android-gradle-plugin build.gradle


【解决方案1】:

我一直在寻找答案,终于到了https://github.com/GoogleCloudPlatform/gradle-appengine-plugin#convention-properties页面:

The task appengineDownloadApp requires you to at least define the application ID and directory to write the files to. Define the tasks properties in the closure app:
  - id: The application ID.
  - version: The current application version (defaults to current default version).
  - outputDirectory: The directory where you wish to save the files (defaults to build/downloaded-app).

所以报错信息中的“appId”属性有点误导...如插件README中所述,您只需添加到build.gradle:

appengine {
    app {
        id = 'your-app-id'
    }
}

【讨论】:

    猜你喜欢
    • 2023-03-29
    • 1970-01-01
    • 2018-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-10
    相关资源
    最近更新 更多