Can't use JSONObject in Google App Engine (Java)?

Half an hour ago, I opened Eclipse to edit the Google App Engine application, everything worked fine earlier, no errors, I didn’t update anything (at least not consciously).

I imported: com.google.appengine.repackaged.org.json.JSONObject no errors, however now I get this error:

use of com.google.appengine.repackaged may result in your app breaking without warning

It has never been interrupted before, it came with downloading the Google App Engine for Eclipse, why did it suddenly start working now? And how can I get rid of him? (they change, I did it very little and quickly, it would be nice not to use another JSON library)

+5
source share
5 answers

com.google.appengine.repackaged.* contains inner classes that should not be used by application code.

org.json , JSON-Java. GAE.

+8

AppEngine 1.8.4

com.google.appengine.labs.repackaged.org.json.JSONObject

+4

, , :

Unfortunately, this adds a lot of warnings, but they seem harmless.

+2
source

To get rid of Using com.google.appengine.repackaged may lead to a violation of your application without warning. error simple declare your class with the full package name . It solves your problem.

com.google.appengine.repackaged.com.google.gson.JsonObject jsonObject = 
new com.google.appengine.repackaged.com.google.gson.JsonObject();
+2
source

Changing my import to com.google.gson.Gson worked for me.

0
source

All Articles