Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] NullException at iOS.Effects.iOSViewStyleEffect.OnDetached #75

Closed
NickeManarin opened this issue Jul 31, 2019 · 3 comments

Comments

@NickeManarin
Copy link

commented Jul 31, 2019

Platform:

  • OS: iOS
  • Device: iPhoneSimulator
  • Sdk version: iOS 12.2
  • Xamarin.Forms: 4.1.0.581479

Describe the bug
I'm getting a NullException when navigating backwards (to a previous page).
I don't remember ever using that iOSViewStyleEffect, so I have no control over it.

View or View.Layer may be null in here:

To Reproduce
Steps to reproduce the behavior:

  1. Run the test project.
  2. Click on Test
  3. Click on Back
  4. See error

Exceptions

System.NullReferenceException: Object reference not set to an instance of an object
  at Sharpnado.Presentation.Forms.iOS.Effects.iOSViewStyleEffect.OnDetached () [0x0001c] in <ec6c6356fc024ba987678ca56d694c54>:0
  at Xamarin.Forms.Effect.SendDetached () [0x00009] in D:\a\1\s\Xamarin.Forms.Core\Effect.cs:62
  at Xamarin.Forms.PlatformEffect`2[TContainer,TControl].SendDetached () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\PlatformEffect.cs:23
  at Xamarin.Forms.Element.set_EffectControlProvider (Xamarin.Forms.IEffectControlProvider value) [0x0002e] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:238
  at Xamarin.Forms.Platform.iOS.EffectUtilities.RegisterEffectControlProvider (Xamarin.Forms.IEffectControlProvider self, Xamarin.Forms.IElementController oldElement, Xamarin.Forms.IElementController newElement) [0x0000e] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00144] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x0008c] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.ViewRenderer`2[TView,TNativeView].Dispose (System.Boolean disposing) [0x0005c] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.Dispose (System.Boolean disposing) [0x00064] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.PageRenderer.Dispose (System.Boolean disposing) [0x00070] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.DisposeHelpers.DisposeModalAndChildRenderers (Xamarin.Forms.Element view) [0x00041] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Platform.iOS.Platform.Xamarin.Forms.INavigation.PopModalAsync (System.Boolean animated) [0x00143] in <0da03a4594684a9bbf17d4a99d39fbc2>:0
  at Xamarin.Forms.Application+NavigationImpl.OnPopModal (System.Boolean animated) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\Application.cs:380
  at TestApp.Helpers.NavigationHelper.GoBackAsync (System.Boolean animated) [0x00030] in /Users/development/Projects/Xamarin.Demos2/TestApp/Helpers/NavigationHelper.cs:74
  at TestApp.ViewModel.SignUpViewModel.Back_Executed () [0x000b6] in /Users/development/Projects/Xamarin.Demos2/TestApp/ViewModel/SignUpViewModel.cs:114
  at TestApp.ViewModel.SignUpViewModel.<.ctor>b__24_0 () [0x0001f] in /Users/development/Projects/Xamarin.Demos2/TestApp/ViewModel/SignUpViewModel.cs:32
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1023
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/Foundation/NSAction.cs:178
  at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/UIKit/UIApplication.cs:86
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.10.0.157/src/Xamarin.iOS/UIKit/UIApplication.cs:65
  at TestApp.iOS.Application.Main (System.String[] args) [0x00001] in /Users/development/Projects/Xamarin.Demos2/TestApp.iOS/Main.cs:17

Test project

https://github.com/NickeManarin/Xamarin.Demos2

@roubachof

This comment has been minimized.

Copy link
Owner

commented Aug 1, 2019

yup I will make some cleanup during august, and pull the effects out of the project (I use mrxten ripple effects).

@NickeManarin

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

Ok, is there anything that I can do to mitigate this issue while it's not fixed?
I can't continue testing my iOS project because of it.

@roubachof

This comment has been minimized.

Copy link
Owner

commented Aug 1, 2019

Don't think so, I won't release something new before the end of august.
What I always do for such case, is fork and wait next release :)

@roubachof roubachof added this to To do in Kanban board Aug 2, 2019
@roubachof roubachof moved this from To do to Done in Kanban board Aug 27, 2019
@roubachof roubachof closed this in 84599a3 Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.