As I don't know where the issue lies, this question might not be about ionic but more about cordova / phonegap. I haven't done phonegap dev for a long time so I don't remember if this is the normal/expected behavour or if I miss something.
I get this kind of errors in my logcat :
11-30 14:39:28.592 16782-16836/com.ionicframework.myproject E/MyProject﹕ Exception: java.lang.NullPointerException
And that's it actually... All the exceptions generated in my application seem to be truncated somehow. I tried displaying either the message or the exception and the result is the same...
The code generating the exception is in my plugin and I know its source but I can give it for reference :
@Override
public boolean execute(String action, JSONArray jsonArray, CallbackContext callbackContext) throws JSONException {
try {
JSONObject visible = jsonArray.getJSONObject(0);
toggleVisibility(visible.getBoolean("visible"), visible.getInt("duration"));
callbackContext.success();
return true;
} catch(Exception e) {
Log.e(TAG, "Exception: " + e);
callbackContext.error(e.getMessage());
return false;
}
Any tips on this point ?
thx
Actually, printStackTrace
for some reason does not work here. The issue here was the incorrect use of the Log class from Android.
This does not print the stacktrace :
Log.e(TAG, "Exception: " + e);
This prints the full stacktrace :
Log.e(TAG, "Exception: ", e);