I am novice android developer & i am learning android from this book http://www.informit.com/store/product.aspx?isbn=9780321673350
I am on chapter 10.
Try getting rid of the trailing slash; this is a file, not a directory.
Make sure adb is in you system path or cd to it first.
Then try the following:
adb shell
cd \data
chmod 777 anr
Then try again.
Don't ask me why the permissions go wonky, but I've had this too.
I solved this error by passing the correct context to the Traces class method call.