wilsonvargas / ButtonCirclePlugin

Circle Buttons with icon for your Xamarin.Forms Applications
MIT License
96 stars 18 forks source link

Does it work with .Net Standard 2.0? #31

Closed stesvis closed 6 years ago

stesvis commented 6 years ago

I followed the exact steps in the example, the project builds but when it's loading the page (android) I get this exception:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.

Is the problem the fact that I am using .Net standard 2.0 instead of the older PCL?

eopeter commented 6 years ago

Seems there is an issue with Icon file binding. Works with Text and not using Icon. Can you try replacing your Icon with Text and see if it crashes?

stesvis commented 6 years ago

I tried that, same result. I just pushed this demo app to a repo https://github.com/stesvis/CircleButtonTest

Is there anything that I forgot to set up maybe?

NOTE: I only initialized it for android in this demo, but in my real app i did iOS too

eopeter commented 6 years ago

I do see your changes and it looks correct. The Text vs Icon may not be the issue then.

stesvis commented 6 years ago

I've had issues with several plugins since .Net standard replaced PCL when you start a new XF project. Could it be some compatibility issue?

eopeter commented 6 years ago

Could be. If you revert this plugin to v 1.2.53, do you still have issues?

stesvis commented 6 years ago

I just did and yes it behaves the same.

AdamGrzesiak commented 6 years ago

Same here :(

pauledenlara commented 6 years ago

buen dia, yo estoy empezando a usar este plugin en un proyecto .Net Standard 2.0,

en android anda de maravilla, pero en ios me marca el error :

ya modificque el archivo info.plist

estoy usando la version 2.0.2.1

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

2018-06-26 10:41:15.312 AppBussat.iOS[25100:386769] Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: value at UIKit.UIButton.set_Font (UIKit.UIFont value) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/UIKit/UIButton.g.cs:758 at ButtonCircle.FormsPlugin.iOS.ButtonCircleRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1[TElement] e) [0x00089] in <6cfc3ee70eb048c8965f01eae7509a12>:0 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00122] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:192 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:141 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014 ] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:198 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:97 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:46 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:179 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:141 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:198 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:97 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:46 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:179 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:141 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:198 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:97 at Xamarin .Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:46 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:179 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:141 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:198 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:97 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:4 6 at Xamarin.Forms.Platform.iOS.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00087] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ScrollViewRenderer.cs:66 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:198 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:97 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:46 at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x00086] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:123 at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr) at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xam arin.iOS/UIKit/UIViewController.g.cs:2938 at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:41 at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0004f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:56 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:198 at Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage (Xamarin.Forms.Page page) [0x00008] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:346 at Xamarin.Forms.Platform.iOS.NavigationRenderer+d__47.MoveNext () [0x0001d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:333

mzhukovs commented 6 years ago

Works fine for me with .net standard instead of PCL. Are you using the correct icon code? The one in the readme is wrong, it shouldn't have the "-ic" in the name, and it crashes the app. If I have time, I'll submit a pull request to NOT crash the app when the icon key provided isn't found and instead display the unicode replacement character.

wilsonvargas commented 6 years ago

Thank you so much!! @mzhukovs all your contributions have been merged to master branch. In this moment i'm uploading new version to nuget.