gpt4 book ai didi

android - 使用 Android Studio 生成 Google Endpoints 库 (JDO)

转载 作者:行者123 更新时间:2023-11-30 02:44:38 27 4
gpt4 key购买 nike

我正在尝试从 Android Studio 生成一个基于 JDO 的端点,但是没有生成库(并且没有显示错误)。我能看到的唯一警告是下面关于注释的警告。

这是我的 gradle 日志:

:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:head:appengineDownloadSdk
:head:compileJava
warning: Implicitly compiled files were not subject to annotation processing.
Use -proc:none to disable annotation processing or -implicit to specify a policy for implicit compilation.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning

:head:processResources UP-TO-DATE
:head:classes
:head:appengineEndpointsGetClientLibs
API client library written to C:\Users\Juan\AndroidStudioProjects\Komi\head\build\client-libs\registration-v1-java.zip
API client library written to C:\Users\Juan\AndroidStudioProjects\Komi\head\build\client-libs\messaging-v1-java.zip
:head:appengineEndpointsExpandClientLibs

显示的两个 API 客户端库是基于 objectify 的,但缺少第三个(基于 JDO)并且似乎被跳过了。我将不胜感激一些帮助,谢谢!

这是 gradle 文件(与文档没有区别):

buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.9'
}
}

repositories {
mavenCentral();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.9'
compile 'com.google.appengine:appengine-endpoints:1.9.9'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.9'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:4.0b3'
compile 'com.ganyo:gcm-server:1.0.2'
compile 'javax.jdo:jdo-api:3.0.1'
compile 'org.datanucleus:datanucleus-core:3.1.4'
compile 'org.datanucleus:datanucleus-api-jdo:3.1.3'
}

appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}

最佳答案

为了让它工作,我修复了一些东西(感谢@loosebazooka)

1) 首先将端点添加到 web.xml

<servlet>
<servlet-name>SystemServiceServlet</servlet-name>
<servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value>com.something.else.Userendpoint, com.something.else.AnotherEndpoint</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>SystemServiceServlet</servlet-name>
<url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>

2) 我的依赖项有一个错误(datanucleous-core 和 datanucleous-jdo-api 的不同版本。一旦我将依赖项更改为 3.1.3 版本增强就开始正常工作并且 Google 端点再次变得很棒.

关于android - 使用 Android Studio 生成 Google Endpoints 库 (JDO),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25282702/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com