Bug 24937 - Crash with UriImageSource with particular URI's
Summary: Crash with UriImageSource with particular URI's
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-30 12:15 UTC by Andrew Westacott
Modified: 2015-01-29 10:47 UTC (History)
8 users (show)

Tags: android
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Andrew Westacott 2014-11-30 12:15:10 UTC
Hi I'm trying to show Facebook profile images in an Image within a ListView using UriImageSource on Android using Xamarin Forms 1.3 pre 1

The following URI works fine: https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/v/t1.0-1/p50x50/10356313_10152858960804740_1402393010425598083_n.jpg?oh=3f553e6f7adf4ded075c33b1e270ab41&oe=54D47EF1&__gda__=1423186967_df15a131f1345eb977c8b3af8a26eb12

but this one (and others) crash or just don't display https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xaf1/v/t1.0-1/c14.14.172.172/s50x50/480520_10151389563453099_1943163511_n.jpg?oh=85752099d94bedff85225016677478e6&oe=550E22BE&__gda__=1426287230_3710e560532e1f3ae730be9303c61f7d

The stack trace for the exception is

System.Diagnostics.Debugger.Mono_UnhandledException_internal () in 
System.Diagnostics.Debugger.Mono_UnhandledException (ex={System.NullReferenceException: Object reference not set to an instance of an object
at Xamarin.Forms.StreamWrapper.Read (byte[],int,int) <IL 0x00009, 0x00033>
at Android.Runtime.InputStreamAdapter.Read (byte[],int,int) [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/src/Runtime/InputStreamAdapter.cs:38
at Java.IO.InputStream.n_Read_arrayBII (intptr,intptr,intptr,int,int) [0x00020] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Java.IO.InputStream.cs:256
at (wrapper dynamic-method) object.b81d275a-09ad-4f23-bc8e-e048034f456f (intptr,intptr,intptr,int,int) <IL 0x00023, 0x00037>
}) in 
object.b81d275a-09ad-4f23-bc8e-e048034f456f (arg0=0xffffffffba549618, arg1=0x20800015, arg2=0x1f600019, arg3=0, arg4=16384) in 
Xamarin.Forms.StreamWrapper.Read (buffer={byte[16384]}, offset=0, count=16384) in 
Android.Runtime.InputStreamAdapter.Read (bytes={byte[16384]}, offset=0, length=16384) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/src/Runtime/InputStreamAdapter.cs:38
Java.IO.InputStream.n_Read_arrayBII (jnienv=0xffffffffba549618, native__this=0x20800015, native_buffer=0x1f600019, byteOffset=0, byteCount=16384) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Java.IO.InputStream.cs:256
object.b81d275a-09ad-4f23-bc8e-e048034f456f (arg0=0xffffffffba549618, arg1=0x20800015, arg2=0x1f600019, arg3=0, arg4=16384) in 
Android.Runtime.JNIEnv.CallStaticObjectMethod (jclass=0x1d2002f6, jmethod=0xffffffff9f42bd40, parms={Android.Runtime.JValue[1]}) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1157
Android.Graphics.BitmapFactory.DecodeStream (is={Xamarin.Forms.StreamWrapper}) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Graphics.BitmapFactory.cs:631
Android.Graphics.BitmapFactory.DecodeStreamAsync.AnonymousMethod__0 () in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Graphics.BitmapFactory.cs:638
System.Threading.Tasks.TaskActionInvoker.FuncInvoke<Android.Graphics.Bitmap>.Invoke (owner=Id = 199, Status = Running, state=(null), context=) in 
System.Threading.Tasks.Task.InnerInvoke (Parameters=) in 
System.Threading.Tasks.Task.ThreadStart (Parameters=) in 
System.Threading.Tasks.Task.Execute (Parameters=) in 
System.Threading.Tasks.TpScheduler.TaskExecuterCallback (Parameters=) in
Comment 1 Rajneesh Kumar 2014-12-01 07:19:52 UTC
I have checked this issue and able to reproduce this issue. To reproduce this issue I have followed the instruction and help provided in bug description.

Steps I followed:

1. Create an Xamarin Forms application.
2. Add an Xaml page to PCL named "MyPage.xaml"
3. Add following code to MyPagexaml.cs:

var TestImage = new Image ();
ImageNonWorking.Source = "Url Goes here.....";
Content = new StackLayout{ 
				Spacing=10,
				VerticalOptions=LayoutOptions.Center,
				Children={TestImage}
			};
4. Call MyPage in App.cs file.
5. Deploy the application on emulator.

Note: Copy and paste the url at place of  "Url Goes here....." provided in bug description, first working url of image and the Non-working url of image and observed that, the working url shows an image, and non-working url shows nothing.  Here is the screencast for the same.

Additional Information: I am not getting any exception, only image does't display.

Screencast: http://www.screencast.com/t/qc5D4inb6wJ3

Environment Info:

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.4.0.43 (Business Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Chris Riesgo 2014-12-03 17:15:54 UTC
I'm seeing this same issue.
Comment 3 Rui Marinho 2015-01-29 10:00:54 UTC
This is fixed in 1.3.2 pre2 and final release.
Comment 4 Rajneesh Kumar 2015-01-29 10:47:39 UTC
I have checked this issue with the following builds:

Xamarin.Forms Version: 1.3.2.6309-pre2
Xamarin Studio Version 5.7.1 (build 15)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:Mono 3.12.0 ((detached/a813491)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000068
Xamarin.Android Version: 4.20.0.28 (Business Edition)
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
=== Build Information ===
Release ID: 507010015
Git revision: ce24e991948c7f3d88b0194a14fc1996d848ef51
Build date: 2015-01-26 16:42:20-05
Xamarin addins: 6895e3222bfa6910524708aa0633ff3db99bc3a0
Operating System Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

I observed that the working url and non-working url provided in bug description, shows image. Here is the screencast for the same. http://www.screencast.com/t/Bcqz72gJJ

This issue has been fixed, hence closing this.