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

Failed to lookup the required marshalling information #31

Closed
gsalve opened this issue Apr 21, 2020 · 6 comments
Closed

Failed to lookup the required marshalling information #31

gsalve opened this issue Apr 21, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@gsalve
Copy link

gsalve commented Apr 21, 2020

Bug Information

Version Number of Plugin: 2.1.0
Device Tested On: iPhone
Simulator Tested On: iPhone 11,( 13.4)
Version of VS: 8.5.2
Version of Xamarin: 4.5.0.617
Versions of other things you are using:

Steps to reproduce the Behavior

  • Run NavigationPage Sample app
  • Standard Demo => Images => Tap To Navigate
  • Click back button it will give the following error

ObjCRuntime.RuntimeException: Failed to lookup the required marshalling information.
Additional information:
Selector: stopAnimating
Type: Xamarin_Forms_Platform_iOS_FormsUIImageView
---> ObjCRuntime.RuntimeException: Failed to get the 'this' instance in a method call to Xamarin.Forms.Platform.iOS.FormsUIImageView.StopAnimating. ---> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7ff67a4693b0 (type: Xamarin_Forms_Platform_iOS_FormsUIImageView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Xamarin.Forms.Platform.iOS.FormsUIImageView' does not have a constructor that takes one IntPtr argument).
at ObjCRuntime.Runtime.MissingCtor (System.IntPtr ptr, System.IntPtr klass, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution resolution) [0x00039] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:1100
at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:1129
at ObjCRuntime.Runtime.ConstructNSObject (System.IntPtr ptr, System.IntPtr klass, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x00010] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:1108
at ObjCRuntime.Runtime.GetNSObject (System.IntPtr ptr, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution, System.Boolean evenInFinalizerQueue) [0x0001c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:1241
at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject (System.Type type, System.IntPtr selector, System.Boolean is_static, System.IntPtr obj, System.IntPtr& mthis, System.IntPtr desc) [0x0004b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/DynamicRegistrar.cs:867
--- End of inner exception stack trace ---
at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject (System.Type type, System.IntPtr selector, System.Boolean is_static, System.IntPtr obj, System.IntPtr& mthis, System.IntPtr desc) [0x00089] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/DynamicRegistrar.cs:874
at ObjCRuntime.Runtime.GetMethodAndObjectForSelector (System.IntPtr klass, System.IntPtr sel, System.Boolean is_static, System.IntPtr obj, System.IntPtr& mthis, System.IntPtr desc) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:744
at ObjCRuntime.Runtime.get_method_and_object_for_selector (System.IntPtr cls, System.IntPtr sel, System.Boolean is_static, System.IntPtr obj, System.IntPtr& mthis, System.IntPtr desc, System.Int32& exception_gchandle) [0x00004] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/runtime/Delegates.generated.cs:431
--- End of inner exception stack trace ---
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/13.16.0.13/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/13.16.0.13/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at TransitionApp.iOS.Application.Main (System.String[] args) [0x00001] in /Users/ganesh/Downloads/Xamarin.Plugin.SharedTransitions-master/src/Sample/TransitionApp/TransitionApp.iOS/Main.cs:17

@gsalve
Copy link
Author

gsalve commented May 11, 2020

Issue is Plugin.SharedTransitions.Platforms.iOS.ViewExtensions Line 91
NSKeyedUnarchiver.UnarchiveObject throwing this error.

@GiampaoloGabba
Copy link
Owner

ummm.... i tought i fixed that.
Are you animating a custom view or something generated by a plugin ?

@sthewissen
Copy link

I have encountered this same issue and it should be reproducible in this repo:
https://github.com/sthewissen/coffeeffee

@GiampaoloGabba
Copy link
Owner

thank you! i stopped the release of the new version (compatible with androidx) to fix this issue. it could be in the next couple of days.

Maybe i'm tryuing to optimize the animation too much and need to stop do duplicating views when i can and just take a snapshot, but then i cant animate borders, ecc

@GiampaoloGabba
Copy link
Owner

ah found it! it has something to do with CG. And when i copy the object it has to be recreated but the Unarchiver needs a constructor wich get an IntPtr as param but the FormsUIIMageView in Xf.Core doesnt have that.
Soooo, if this plugin was in core i will be able to fix this with just 1 line of code :(
For now i have to do something more creative :)

@sthewissen
Copy link

sthewissen commented May 24, 2020 via email

@GiampaoloGabba GiampaoloGabba added the bug Something isn't working label May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants