question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.1.1.-pre1: System.ArgumentNullException: Value cannot be null.

See original GitHub issue

FFImageLoading stopped working for me. When I load a listview with embedded png resources, I get this error and the app crashes.

System.ArgumentNullException: Value cannot be null.
Parameter name: key

Thread finished: <Thread Pool> #4
05-27 17:00:30.431 D/Mono    (17366): [0xd8e2e930] worker finishing
Thread finished: <Thread Pool> #3
05-27 17:00:37.861 D/Mono    (17366): [0xd8f3f930] worker finishing
Thread finished: <Thread Pool> #2
Thread finished: <Thread Pool> #6
05-27 17:00:50.661 D/Mono    (17366): [0xd4aff930] worker finishing
05-27 17:01:01.781 D/Mono    (17366): DllImport attempting to load: '/system/lib/liblog.so'.
05-27 17:01:01.781 D/Mono    (17366): DllImport loaded library '/system/lib/liblog.so'.
05-27 17:01:01.781 D/Mono    (17366): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
05-27 17:01:01.781 D/Mono    (17366): Searching for '__android_log_print'.
05-27 17:01:01.781 D/Mono    (17366): Probing '__android_log_print'.
05-27 17:01:01.781 D/Mono    (17366): Found as '__android_log_print'.
05-27 17:01:01.801 I/MonoDroid(17366): UNHANDLED EXCEPTION:
05-27 17:01:01.801 I/MonoDroid(17366): System.ArgumentNullException: Value cannot be null.
05-27 17:01:01.801 I/MonoDroid(17366): Parameter name: key
05-27 17:01:01.801 I/MonoDroid(17366):   at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (System.Collections.Concurrent.TKey key, System.Func`2 valueFactory) [0x0000b] in /Users/builder/data/lanes/1196/3e934261/source/mono/external/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1041 
05-27 17:01:01.801 I/MonoDroid(17366):   at FFImageLoading.Work.ImageLoaderTaskBase.GetKey (System.String path, Boolean raw) [0x00044] in <filename unknown>:0 
05-27 17:01:01.801 I/MonoDroid(17366):   at FFImageLoading.Work.ImageLoaderTaskBase.CanUseMemoryCache (System.String path) [0x00000] in <filename unknown>:0 
05-27 17:01:01.801 I/MonoDroid(17366):   at FFImageLoading.Work.WorkScheduler+<LoadImage>d__19.MoveNext () [0x0015b] in <filename unknown>:0 
05-27 17:01:01.801 I/MonoDroid(17366): --- End of stack trace from previous location where exception was thrown ---
05-27 17:01:01.801 I/MonoDroid(17366):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/1196/3e934261/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
05-27 17:01:01.801 I/MonoDroid(17366):   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in /Users/builder/data/lanes/1196/3e934261/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 
05-27 17:01:01.801 I/MonoDroid(17366):   at Android.App.SyncContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/3204/804c6cb7/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:18 
05-27 17:01:01.801 I/MonoDroid(17366):   at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/3204/804c6cb7/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36 
05-27 17:01:01.801 I/MonoDroid(17366):   at Java.Lang.IRunnableInvoker.n_Run (IntPtr jnienv, IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3204/804c6cb7/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Java.Lang.IRunnable.cs:81 
05-27 17:01:01.801 I/MonoDroid(17366):   at (wrapper dynamic-method) System.Object:ed241693-715f-4c00-893b-efe451ca4a51 (intptr,intptr)
05-27 17:01:01.831 I/art     (17366): Starting a blocking GC Explicit
05-27 17:01:01.851 I/art     (17366): Explicit concurrent mark sweep GC freed 8435(640KB) AllocSpace objects, 4(64KB) LOS objects, 67% free, 7MB/23MB, paused 320us total 17.296ms
05-27 17:01:01.851 D/Mono    (17366): GC_OLD_BRIDGE num-objects 51 num_hash_entries 52 sccs size 52 init 0.00ms df1 0.12ms sort 0.09ms dfs2 0.20ms setup-cb 0.06ms free-data 0.05ms links 1/1/1/1 dfs passes 104/53
05-27 17:01:01.851 D/Mono    (17366): GC_MINOR: (Nursery full) pause 11.69ms, total 11.93ms, bridge 0.00ms promoted 416K major 3104K los 725K
05-27 17:01:01.861 W/art     (17366): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
05-27 17:01:01.861 D/Mono    (17366): DllImport searching in: '__Internal' ('(null)').
05-27 17:01:01.861 D/Mono    (17366): Searching for 'java_interop_jnienv_throw'.
05-27 17:01:01.861 D/Mono    (17366): Probing 'java_interop_jnienv_throw'.
05-27 17:01:01.861 D/Mono    (17366): Found as 'java_interop_jnienv_throw'.
The thread 'Unknown' (0x4) has exited with code 0 (0x0).
The thread 'Unknown' (0x3) has exited with code 0 (0x0).
The thread 'Unknown' (0x2) has exited with code 0 (0x0).
The thread 'Unknown' (0x6) has exited with code 0 (0x0).
An unhandled exception occured.

05-27 17:01:03.891 E/mono    (17366): 
05-27 17:01:03.891 E/mono    (17366): Unhandled Exception:
05-27 17:01:03.891 E/mono    (17366): System.ArgumentNullException: Value cannot be null.
05-27 17:01:03.891 E/mono    (17366): Parameter name: key
05-27 17:01:03.891 E/mono    (17366):   at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (System.Collections.Concurrent.TKey key, System.Func`2 valueFactory) [0x0000b] in /Users/builder/data/lanes/1196/3e934261/source/mono/external/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1041 
05-27 17:01:03.891 E/mono    (17366):   at FFImageLoading.Work.ImageLoaderTaskBase.GetKey (System.String path, Boolean raw) [0x00044] in <filename unknown>:0 
05-27 17:01:03.891 E/mono    (17366):   at FFImageLoading.Work.ImageLoaderTaskBase.CanUseMemoryCache (System.String path) [0x00000] in <filename unknown>:0 
05-27 17:01:03.891 E/mono    (17366):   at FFImageLoading.Work.WorkScheduler+<LoadImage>d__19.MoveNext () [0x0015b] in <filename unknown>:0 
05-27 17:01:03.891 E/mono    (17366): --- End of stack trace from previous location where exception was thrown ---
05-27 17:01:03.891 E/mono    (17366):   at (wrapper dynamic-method) System.Object:ed241693-715f-4c00-893b-efe451ca4a51 (intptr,intptr)
05-27 17:01:03.891 E/mono    (17366):   at (wrapper native-to-managed) System.Object:ed241693-715f-4c00-893b-efe451ca4a51 (intptr,intptr)
05-27 17:01:03.891 E/mono-rt (17366): [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null.
05-27 17:01:03.891 E/mono-rt (17366): Parameter name: key
05-27 17:01:03.891 E/mono-rt (17366):   at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (System.Collections.Concurrent.TKey key, System.Func`2 valueFactory) [0x0000b] in /Users/builder/data/lanes/1196/3e934261/source/mono/external/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1041 
05-27 17:01:03.891 E/mono-rt (17366):   at FFImageLoading.Work.ImageLoaderTaskBase.GetKey (System.String path, Boolean raw) [0x00044] in <filename unknown>:0 
05-27 17:01:03.891 E/mono-rt (17366):   at FFImageLoading.Work.ImageLoaderTaskBase.CanUseMemoryCache (System.String path) [0x00000] in <filename unknown>:0 
05-27 17:01:03.891 E/mono-rt (17366):   at FFImageLoading.Work.WorkScheduler+<LoadImage>d__19.MoveNext () [0x0015b] in <filename unknown>:0 
05-27 17:01:03.891 E/mono-rt (17366): --- End of stack trace from previous location where exception was thrown ---
05-27 17:01:03.891 E/mono-rt (17366):   at (wrapper dynamic-method) System.Object:ed241693-715f-4c00-893b-efe451ca4a51 (intptr,intptr)
05-27 17:01:03.891 E/mono-rt (17366):   at (wrapper native-to-managed) System.Object:ed241693-715f-4c00-893b-efe451ca4a51 (intptr,intptr)
Thread started: <Thread Pool> #8
Thread started: <Thread Pool> #9
05-27 17:01:03.921 D/Mono    (17366): [0xd8e2e930] worker starting
Thread started: <Thread Pool> #10
05-27 17:01:03.941 D/Mono    (17366): [0xd4aff930] worker starting
Thread started: <Thread Pool> #11
05-27 17:01:03.961 D/Mono    (17366): [0xd6d56930] worker starting
referenceTable GDEF length=814 1
referenceTable GSUB length=11364 1
referenceTable GPOS length=47302 1
referenceTable head length=54 1
referenceTable GDEF length=808 1
referenceTable GSUB length=11364 1
referenceTable GPOS length=49206 1
referenceTable head length=54 1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
softsancommented, Jun 2, 2016

Updated XF to 2.3.0.46-pre3 and FFImage to 2.1.1-pre2 but have the same issue on iOS List view scrolling:

System.ArgumentNullExceptionValue cannot be null. Parameter name: key

FFImageLoading.Concurrency.ConcurrentDictionary<TKey, TValue>.ThrowKeyNullException()
FFImageLoading.Concurrency.ConcurrentDictionary<TKey, TValue>.TryRemove(TKey key, ref TValue value)
FFImageLoading.Work.WorkScheduler.RemovePendingTask(IImageLoaderTask task)
FFImageLoading.ImageService.RemovePendingTask(IImageLoaderTask task)
FFImageLoading.Work.ImageLoaderTaskBase.Cancel()
FFImageLoading.Forms.Touch.CachedImageRenderer.Cancel()
FFImageLoading.Forms.Touch.CachedImageRenderer.SetImage(CachedImage oldElement)
FFImageLoading.Forms.Touch.CachedImageRenderer.OnElementChanged(ElementChangedEventArgs<_> e)
Xamarin.Forms.Platform.iOS.VisualElementRenderer<TElement>.SetElement(TElement element)
Xamarin.Forms.Platform.iOS.VisualElementRenderer<TElement>.SetElement(VisualElement element)
Xamarin.Forms.Platform.iOS.RendererPool.UpdateRenderers(Element newElement)
Xamarin.Forms.Platform.iOS.RendererPool.UpdateNewElement(VisualElement newElement)
Xamarin.Forms.Platform.iOS.VisualElementPackager.SetElement(VisualElement oldElement, VisualElement newElement)
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnRendererElementChanged(object sender, VisualElementChangedEventArgs args)
Xamarin.Forms.Platform.iOS.VisualElementRenderer<TElement>.OnElementChanged(ElementChangedEventArgs<_> e)
Xamarin.Forms.Platform.iOS.VisualElementRenderer<TElement>.SetElement(TElement element)
Xamarin.Forms.Platform.iOS.VisualElementRenderer<TElement>.SetElement(VisualElement element)
Xamarin.Forms.Platform.iOS.ViewCellRenderer.ViewTableCell.UpdateCell(ViewCell cell)
Xamarin.Forms.Platform.iOS.ViewCellRenderer.ViewTableCell.set_ViewCell(ViewCell value)
Xamarin.Forms.Platform.iOS.ViewCellRenderer.GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
Xamarin.Forms.Platform.iOS.CellTableViewCell.GetNativeCell(UITableView tableView, Cell cell, bool recycleCells, string templateId)
Xamarin.Forms.Platform.iOS.ListViewRenderer.ListViewDataSource.GetCell(UITableView tableView, NSIndexPath indexPath)
UIKit.UIApplication.UIApplicationMain(int, string[], intptr, intptr)(wrapper managed-to-native)
UIKit.UIApplication.Main(string[] args, IntPtr principal, IntPtr delegate)UIApplication.cs:77
UIKit.UIApplication.Main(string[] args, string principalClassName, string delegateClassName)UIApplication.cs:60
sampleapp.iOS.Application.Main(string[] args)Main.cs:37
0reactions
softsancommented, Jun 3, 2016

FFImageLoading 2.1.1 fixed the issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UGS Release Notes
Fixed: NullReferenceException when passing null for the currency code to ConvertCurrencyToMinorUnits ; it now throws an ArgumentNullException if the currency ...
Read more >
Changelog | TextMeshPro | 1.6.0-preview.1
Fixed Argument Null Exception when attempting to create a font asset ... Fixed GetPreferredValues() potentially returning incorrect values.
Read more >
github_data_SentiStrength-SE_results_initial.txt
242635," Can't compile X64 under vs2010, returnng this error ... Then, if `null` it will use the value of `color` for the ambient...
Read more >
Unity logcat debug log - Hidramaco
Corrected initialize the value of a Nullable when the nullable object is created via the null coalescing operator from a null value.
Read more >
OptimizedConfigurationMethodS...
Item"> <summary> Gets a value indicating the <see cref="T:System. ... This class cannot be inherited. ... ArgumentNullException">The expression is null.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found