Android - java.lang.RuntimeException: Stub exception while parsing String into JSONObject
It is probably because you are using android-provided json implementation and you are not running it on an android device or emulator.
Depending on your real need you can either :
- run it on a device or emulator
- use another json library instead of the one embedded in android
- use roboelectric to run your test (if it's a test) without an emulator : http://robolectric.org/