NullPointerException : println needs a message in android
Maybe there's simply no message attached in exception you're catching. Try ex.printStackTrace();
instead. Hope this helps.
For anyone else that gets this, try replacing the lone method call or variable name with "" + varName.
For example,
Log.d("LOGCAT", getErrorMsg());
becomes
Log.d("LOGCAT", "" + getErrorMsg());
In the catch, use:
String err = (ex.getMessage()==null)?"SD Card failed":ex.getMessage();
Log.e("sdcard-err2:", err);
Passing null
to the second argument of a Log
logging function throws that error, regardless of the source.