2

I tried to obfuscate my project in j2me..But it is showing the following error.I came to know that this obfuscation error happened only when i importing Json.jar in my project..If i remove this jar means obfuscation is happening..Please help me solve this..Thanks in advance.

Warning: org.json.me.JSONArray: can't find referenced method 'java.lang.Object remove(int)' in class java.util.Vector
Warning: there were 1 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile them and try again.
         Alternatively, you may have to specify the options 
         '-dontskipnonpubliclibraryclasses' and/or
         '-dontskipnonpubliclibraryclassmembers'.
Error: Please correct the above warnings first.
C:\Users\Ponmani\Documents\TThehinduNov22ponmani\nbproject\build-impl.xml:427: Obfuscation failed with error code 1.
BUILD FAILED (total time: 4 seconds)
Subburaj
  • 5,114
  • 10
  • 44
  • 87

1 Answers1

2

This error happens because the JSONArray class uses remove(int) method from Vector class, but this method is not available for Java ME: http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/util/Vector.html

You picked a Java Se version of the library. Please, try this other library: https://github.com/upictec/org.json.me/

Update
There is a ZIP button where you can download the repository as a zip file.
Inside the zip file enter /src/main/java.
Copy org folder and paste it in your src folder.

Telmo Pimentel Mota
  • 4,033
  • 16
  • 22
  • Thanks Telmo Pimentel Mota..I am new to this can u give more explanation and give detail about what i have to do.. – Subburaj Dec 10 '12 at 11:48
  • Thanks Telmo Pimentel Mota..it helped me a lot..But i need explanation Telmo Pimentel Mota..Y because i have to give reason for my higher official y i did this..So please give some link regarding this... – Subburaj Dec 11 '12 at 04:25
  • Initially you picked a Java SE compiled version of the library. Now you are using the source code of a Java ME version. – Telmo Pimentel Mota Dec 11 '12 at 11:23