2

I have received an email from GCP to migrate my project from Cloud Endpoints 1.0 to Cloud Endpoints Frameworks 2.0.

I've followed the steps outlined here: https://cloud.google.com/appengine/docs/java/endpoints/migrating?authuser=0

In my previous build.gradle I had this directive to enhance my endpoints and it worked fine:

appengine {
    downloadSdk = true
    appcfg {
        oauth2 = true
    }
    endpoints {
        getClientLibsOnBuild = true
        getDiscoveryDocsOnBuild = true
    }
    enhancer {
        version = "v2"
        api="jdo"  // or "jpa"
        enhanceOnBuild = true
    }
}

However, after migration and on compile, I get the following error:

Error:(60, 0) Could not find method enhancer() for arguments [build_2dn4fni12bkrsqgsi25gsx3hh$_run_closure2$_closure7@6b02ee9e] on object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension.

And if I remove the enhancer part, I get the following error:

org.datanucleus.metadata.MetaDataManager initialiseFileMetaDataForUse: Found Meta-Data for class [...] but this class is not enhanced!! Please enhance the class before running DataNucleus.

So, what is the equivalent enhancing in the new framework? (I'm using Android Studio 2.3.3)

4

2 回答 2

0

问题是新的 gradle 插件没有appengineEnhance增强 jpa/jdo 类所需的任务。

这里有一个解决方法https://stackoverflow.com/a/29279504/3190492

不需要块中的enhancer {...}部分并且应该在上面链接中的脚本中完成配置也是毫无价值的。appengine

于 2017-08-11T10:29:57.243 回答
0

我直接从 Google Cloud Support 得到了这个回复:

最新版本的 Endpoints v2 排除了一些功能和工具,目前不可用。如果您的应用程序需要以下任何一项,则不建议您迁移。

  • JSON-RPC 协议,这是旧版 iOS 客户端所必需的
  • 自动 ETag
  • 自动种类字段
  • IDE 集成
  • 字段部分响应

同时,以下是 v2.0 目前不支持的工具:

  • Android Studio 对 Cloud Endpoints 1.0 的支持
  • Cloud Endpoints 1.0 的 Android Studio 代码验证和快速修复

那么,关于“增强器”方法,您是否检查过它是否包含在上述功能中?如果是这样,您唯一的方法是检查等效功能或再次降级到 v1.0。

这不是我希望的答案,但至少在他们正式支持这些功能之前,我们不应该迁移到 Endpoints Framework v2.0。

于 2017-08-09T13:42:13.027 回答