如何在Android Studio中使用com.google.appengine.labs.repackaged.org.json(How to use com.google.appengine.la

编程入门 行业动态 更新时间:2024-10-09 09:18:53
如何在Android Studio中使用com.google.appengine.labs.repackaged.org.json(How to use com.google.appengine.labs.repackaged.org.json in Android Studio)

我有工作代码使用JSON与下面显示的包。

import com.google.appengine.labs.repackaged.org.json.JSONException; import com.google.appengine.labs.repackaged.org.json.JSONObject;

代码在app引擎中运行,在eclipse下构建。 现在我正在尝试将其迁移到Android Studio。 但我无法找到如何用它来引用正确的库,所以我无法编译。 我当前的build.gradle文件如下所示。

buildscript { repositories { jcenter() } dependencies { classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18' } } repositories { jcenter(); } apply plugin: 'java' apply plugin: 'war' apply plugin: 'appengine' war.dependsOn appengineEnhance sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 dependencies { appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18' compile 'com.google.appengine:appengine-endpoints:1.9.18' compile 'com.google.appengine:appengine-endpoints-deps:1.9.18' compile 'com.google.appengine.orm:datanucleus-appengine:2.1.2' compile 'javax.servlet:servlet-api:2.5' compile 'javax.jdo:jdo2-api:2.3-eb' compile 'org.datanucleus:datanucleus-api-jdo:3.1.3' } appengine { downloadSdk = true appcfg { oauth2 = true } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } enhancer { version = "v2" api="jdo" enhanceOnBuild = true } }

我还需要添加其他库,但我想先解决这个问题。

I have working code which uses JSON with package shown below.

import com.google.appengine.labs.repackaged.org.json.JSONException; import com.google.appengine.labs.repackaged.org.json.JSONObject;

Code runs in app engine, built under eclipse. And now I'm trying to migrate it to Android Studio. But I can't find out how to refer correct library with it, so I can't compile. My current build.gradle file is shown below.

buildscript { repositories { jcenter() } dependencies { classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18' } } repositories { jcenter(); } apply plugin: 'java' apply plugin: 'war' apply plugin: 'appengine' war.dependsOn appengineEnhance sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 dependencies { appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18' compile 'com.google.appengine:appengine-endpoints:1.9.18' compile 'com.google.appengine:appengine-endpoints-deps:1.9.18' compile 'com.google.appengine.orm:datanucleus-appengine:2.1.2' compile 'javax.servlet:servlet-api:2.5' compile 'javax.jdo:jdo2-api:2.3-eb' compile 'org.datanucleus:datanucleus-api-jdo:3.1.3' } appengine { downloadSdk = true appcfg { oauth2 = true } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } enhancer { version = "v2" api="jdo" enhanceOnBuild = true } }

There are other libraries I need to add but I want to fix this issue first.

最满意答案

我找到了解决方案。 在build.gradle中添加下一行成功编译。

compile 'com.google.appengine:appengine-api-labs:1.7.4'

现在我可以继续运行/调试服务器端代码。

I found a solution. Adding next line to build.gradle made successful compile.

compile 'com.google.appengine:appengine-api-labs:1.7.4'

Now I can go forward to run/debug server side code.

更多推荐

本文发布于:2023-07-27 04:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1284859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Studio   google   appengine   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!