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。