Closed xxccll closed 8 years ago
Is there really no logcat output related to your app crash at all?
here is the log information I got right now
08-19 13:51:15.624 2516-2516/? D/﹕ HostConnection::get() New Host Connection established 0x9a9b300, tid 2516 08-19 13:51:15.629 2516-2530/? D/dalvikvm﹕ Trying to load lib /data/data/com.deepdevelop.client/lib/libmemchunk.so 0xb6577800 08-19 13:51:15.629 2516-2530/? D/dalvikvm﹕ Added shared lib /data/data/com.deepdevelop.client/lib/libmemchunk.so 0xb6577800 08-19 13:51:15.632 2516-2530/? I/dalvikvm﹕ Could not find method android.graphics.Bitmap.getAllocationByteCount, referenced from method com.facebook.imageutils.BitmapUtil.getSizeInBytes 08-19 13:51:15.632 2516-2530/? W/dalvikvm﹕ VFY: unable to resolve virtual method 546: Landroid/graphics/Bitmap;.getAllocationByteCount ()I 08-19 13:51:15.632 2516-2530/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000a 08-19 13:51:15.632 2516-2530/? I/dalvikvm﹕ Could not find method android.graphics.Bitmap.getByteCount, referenced from method com.facebook.imageutils.BitmapUtil.getSizeInBytes 08-19 13:51:15.632 2516-2530/? W/dalvikvm﹕ VFY: unable to resolve virtual method 547: Landroid/graphics/Bitmap;.getByteCount ()I 08-19 13:51:15.632 2516-2530/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0016 08-19 13:51:15.632 2516-2530/? D/dalvikvm﹕ VFY: dead code 0x000d-000e in Lcom/facebook/imageutils/BitmapUtil;.getSizeInBytes (Landroid/graphics/Bitmap;)I 08-19 13:51:15.632 2516-2530/? D/dalvikvm﹕ VFY: dead code 0x0019-001a in Lcom/facebook/imageutils/BitmapUtil;.getSizeInBytes (Landroid/graphics/Bitmap;)I 08-19 13:51:15.632 2516-2531/? I/dalvikvm﹕ Could not find method android.graphics.Bitmap.getAllocationByteCount, referenced from method com.facebook.imagepipeline.nativecode.Bitmaps.reconfigureBitmap 08-19 13:51:15.632 2516-2531/? W/dalvikvm﹕ VFY: unable to resolve virtual method 546: Landroid/graphics/Bitmap;.getAllocationByteCount ()I 08-19 13:51:15.632 2516-2531/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0000 08-19 13:51:15.632 2516-2531/? D/dalvikvm﹕ VFY: dead code 0x0003-0015 in Lcom/facebook/imagepipeline/nativecode/Bitmaps;.reconfigureBitmap (Landroid/graphics/Bitmap;II)V 08-19 13:51:15.632 2516-2531/? D/dalvikvm﹕ Trying to load lib /data/data/com.deepdevelop.client/lib/libbitmaps.so 0xb6577800 08-19 13:51:15.632 156-295/system_process I/ActivityManager﹕ Process com.deepdevelop.client (pid 2516) has died. 08-19 13:51:15.636 156-295/system_process I/WindowManager﹕ WIN DEATH: Window{b66ff9c8 com.deepdevelop.client/com.deepdevelop.client.app.MainActivity paused=false}
and I've made mistake before,code below works normally
String url = "https://avatars1.githubusercontent.com/u/2957584?v=3&s=96";
// GenericDraweeHierarchy hierarchy = simpleDraweeView.getHierarchy();
// RoundingParams roundingParams = hierarchy.getRoundingParams();
// if (roundingParams == null) {
// roundingParams = new RoundingParams();
// }
// roundingParams.setCornersRadius(5);
// hierarchy.setRoundingParams(roundingParams);
simpleDraweeView.setImageURI(Uri.parse(url));
but
String url = "https://avatars1.githubusercontent.com/u/2957584?v=3&s=96";
GenericDraweeHierarchy hierarchy = simpleDraweeView.getHierarchy();
RoundingParams roundingParams = hierarchy.getRoundingParams();
if (roundingParams == null) {
roundingParams = new RoundingParams();
}
roundingParams.setCornersRadius(5);
hierarchy.setRoundingParams(roundingParams);
simpleDraweeView.setImageURI(Uri.parse(url));
crash.
Ok this is weird. The crash indicates that it is calling Bitmap.getByteCount from BitmapUtil.getSizeInBytes. But that method is not supposed to be called on Gingerbread.
What are the minSdkVersion and targetSdkVersion in your app? Does this happen on a physical Gingerbread device, or just the emulator?
sorry,I've been on vacation.
I just test on the emulator, and my placeholderImage is a JPEG(106x149) file, and I set the SimpleDraweeView like this
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/my_image_view"
android:layout_width="200dp"
android:layout_height="220dp"
fresco:placeholderImage="@drawable/nopic"
/>
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
}
}
Are you using Fresco 0.7.0? I am not sure now if the logcat you posted earlier is actually the crash. There is usually a stack trace there somewhere. Can you follow our logging instructions?
I test fresco on Genymotion device:
then the app crashed and I can't read any error information from the logcat.
if I don't use
setImageURI()
method,thesimpleDraweeView
can display normally with the attributefresco:placeholderImage="@drawable/nopic"