2

我收到了一封来自GCP的电子邮件,将我的项目从Cloud Endpoints 1.0迁移到Cloud Endpoints Frameworks 2.0。增强云端点框架2.0的App Engine端点

我已经按照这里列出的步骤:我有这个指令,以提高我的终点https://cloud.google.com/appengine/docs/java/endpoints/migrating?authuser=0

在我以前的build.gradle和它工作得很好:

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

但是,迁移后和编译,我得到以下错误:

Error:(60, 0) Could not find method enhancer() for arguments [[email protected]] on object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension.

如果我删除enhancer部分,我得到以下错误:

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

那么,新框架中的等效增强是什么? (我使用的是Android 2.3.3工作室)

回答

0

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

有此这里https://stackoverflow.com/a/29279504/3190492

解决方法这也是一文不值,在appengineenhancer {...}部分不会被要求和配置应该在上面的链接脚本来完成。

+0

谢谢,但我得到的错误: 的taskdef类org.datanucleus.enhancer.EnhancerTask不能使用AntClassLoader – doctorram

+0

只好用'类加载器中找到“org.datanucleus.enhancer.tools.EnhancerTask'' – doctorram

+0

谢谢你的提示....它应该在谷歌应用引擎端点框架V2文档(同样的方式,应该明确表示,你需要升级到Android支持26)... ...新版本没有准备好,人们不应该被推动迁移的东西不完整,而失去很多时间...我们被用作实验室老鼠的错误测试 – mg3

0

我直接从谷歌云支持这样的响应:

There are some features and tools that are excluded and currently unavailable with the latest version of Endpoints v2. If your application requires any of the below mentioned, you are not recommended to migrate.

  • JSON-RPC protocol, which is required for legacy iOS clients
  • Automatic ETags
  • Automatic Kind fields
  • IDE integration
  • fields partial responses

Meanwhile, below are the tools that are currently not supported in v2.0:

  • Android Studio support for Cloud Endpoints 1.0
  • Android Studio code validation and quick fixes for Cloud Endpoints 1.0

So, with regards to the 'enhancer' method, have you checked if this is included on the aforementioned features? If so, the only way for you to do is check for an equivalent function or downgrade again to v1.0.

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