Sunday, April 29, 2012

[android-developers] Re: Strange force close on Froyo phone, works fine on ICS tablet


it is telling Mode.ADD is not exists in 2.2
On Sunday, April 29, 2012 12:45:34 PM UTC-4, Spooky wrote:
The following code (which works fine earlier in the app on both devices)
causes a force close (logcat below) on my Froyo phone (Motorola Bravo
MB520), and works fine on my ICS tablet (Acer Iconia A500):

---------------------------  CUT HERE  ---------------------------
Canvas canvas = new Canvas(saveme);
Paint paint = new Paint();

canvas = new Canvas(saveme);
paint = new Paint();
canvas.drawBitmap(image, 0, 0, paint);
// the following is line 1071...the source of the exception/error
paint.setXfermode(new PorterDuffXfermode(;
canvas.drawBitmap(filter, 0, 0, paint);
---------------------------  CUT HERE  ---------------------------

And here's the error in logcat:

---------------------------  CUT HERE  ---------------------------
D/AndroidRuntime(3550): Shutting down VM
W/dalvikvm(3550): threadid=1: thread exiting with uncaught exception (group=0x400208b0)
E/AndroidRuntime(3550): FATAL EXCEPTION: main
E/AndroidRuntime(3550): java.lang.NoSuchFieldError:$Mode.ADD
E/AndroidRuntime(3550):    at com.jdgapps.UltraCamPro.UltraCamPro$1.onPictureTaken(
E/AndroidRuntime(3550):    at android.hardware.Camera$EventHandler.handleMessage(
E/AndroidRuntime(3550):    at android.os.Handler.dispatchMessage(
E/AndroidRuntime(3550):    at android.os.Looper.loop(
E/AndroidRuntime(3550):    at
E/AndroidRuntime(3550):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(3550):    at java.lang.reflect.Method.invoke(
E/AndroidRuntime(3550):    at$
E/AndroidRuntime(3550):    at
E/AndroidRuntime(3550):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(1321):   Force finishing activity com.jdgapps.UltraCamPro/.UltraCamPro
 ---------------------------  CUT HERE  ---------------------------
On my tablet, it doesn't throw an error, and continues on to create the
final image, save it, and return to the camera preview.  Note that this
very same Porterduff code works fine earlier in the app (also blending
two bitmaps---different variable names...only difference), and also WAS
working at this point previously (before a name change, some unused
imports removed, two[1] that Eclipse said were unused replaced because
Eclipse complained when they weren't there after I removed them because
Eclipse said they weren't used).  Oh, one more change:  Target SDK
stepped up from Android 3.2.1 to Android 4.0.3, min SDK stayed at Android
2.2.1.  Tablet also changed from Android 3.2.1 to 4.0.3.

Can anyone help explain this mystery?


[1] and

73 DE N5IAL (/4)        | Peter da Silva:  No, try "rm -rf /"    | Dave Aronson:    As your life flashes before
< Running FreeBSD 7.0 > |      your eyes, in the unit of time known as an
ICBM / Hurricane:       |      ohnosecond....     (alt.sysadmin.recovery)
   30.44406N 86.59909W  |

Android Apps Listing at

You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment