SimonSimCity / Xamarin-CrossDownloadManager

A cross platform download manager for Xamarin
MIT License
149 stars 68 forks source link

Null Pointer exception when downloading file other than pdf #120

Closed Adeel984 closed 4 years ago

Adeel984 commented 4 years ago
  at Foundation.NSMutableUrlRequest..ctor (Foundation.NSUrl url) [0x00014] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/Foundation/NSMutableUrlRequest.g.cs:98 
  at Plugin.DownloadManager.DownloadFileImplementation.StartDownload (Foundation.NSUrlSession session, System.Boolean allowsCellularAccess) [0x0000c] in <16325dc098204cefa1ba7d052c3f76d5>:0 
  at Plugin.DownloadManager.DownloadManagerImplementation+<>c__DisplayClass18_0.<Start>b__0 () [0x00038] in <16325dc098204cefa1ba7d052c3f76d5>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/Foundation/NSAction.cs:152 

Steps to reproduce

1.

  var downloadManager = CrossDownloadManager.Current;
//Url http://domainName.com/img/upload/Testing Word File.docx_20191224101258.docx
  var file = downloadManager.CreateDownloadFile(url);
  downloadManager.Start(file);

Expected behavior

Should download the file as it does (PDF Files are downloading) the same are also downloading with my custom implementation on Android Download manager.

Actual behavior

throws null pointer exception at Plugin.DownloadManager.DownloadFileImplementation.StartDownload

Configuration

Platform:

Device:

SimonSimCity commented 4 years ago

Please include more information. Can you reproduce this on a real device? Where in the system does it throw the exception? Can you please post a stack-trace from a debug-build of your application?

Better even would be you take the sample folder and modify the version in there so I can reproduce the error.

Adeel984 commented 4 years ago

Thanks for your kind response. Actually the issue was with my URL. I faced similar issue while downloading with DownloadManager in Android.