I am getting these errors while parsing JSON.
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/shivamblog100/AttachmentUrl/AttachmentUrl.java:70: error: cannot find symbol
[javac] JSONObject jsn = JSONObject(response);
[javac] symbol: method JSONObject(String)
[javac] location: class AttachmentUrl
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
These are my imports to parse JSON:
Kindly help me in fixing these errors. Thank you.
It seems you are trying to develop an extension with the app inventor sources. It is best to ask for help in the open source development category of the App Inventor community.
Yeah, I am using Appy Builder editor because Kodular editor is not working. Also, my PC is not working properly nowadays, so I am doing it on my mobile. Is it wrong to ask these errors here?
Since you are using a Kodular product i will list your question again.
Thank you for your response.
JSONObject(String) is a constructer, however, you are using it in your code as a method as the error implies, you might try to use the
new statement before the constructor to indicate that you are constructing a new
JSONObject class instance, as in this example:
JSONObject jsn = new JSONObject(response);
Thanks. It solved my error.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.