{"action":"closed","issue":{"url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1697","repository_url":"https://api.github.com/repos/reactiveui/ReactiveUI","labels_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1697/labels{/name}","comments_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1697/comments","events_url":"https://api.github.com/repos/reactiveui/ReactiveUI/issues/1697/events","html_url":"https://github.com/reactiveui/ReactiveUI/issues/1697","id":344751831,"node_id":"MDU6SXNzdWUzNDQ3NTE4MzE=","number":1697,"title":"ReactiveUI.Events + mtouch argument --registrar:static leads to failing build","user":{"login":"TobiasBuchholz","id":1132836,"node_id":"MDQ6VXNlcjExMzI4MzY=","avatar_url":"https://avatars0.githubusercontent.com/u/1132836?v=4","gravatar_id":"","url":"https://api.github.com/users/TobiasBuchholz","html_url":"https://github.com/TobiasBuchholz","followers_url":"https://api.github.com/users/TobiasBuchholz/followers","following_url":"https://api.github.com/users/TobiasBuchholz/following{/other_user}","gists_url":"https://api.github.com/users/TobiasBuchholz/gists{/gist_id}","starred_url":"https://api.github.com/users/TobiasBuchholz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobiasBuchholz/subscriptions","organizations_url":"https://api.github.com/users/TobiasBuchholz/orgs","repos_url":"https://api.github.com/users/TobiasBuchholz/repos","events_url":"https://api.github.com/users/TobiasBuchholz/events{/privacy}","received_events_url":"https://api.github.com/users/TobiasBuchholz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-26T08:50:33Z","updated_at":"2018-07-26T13:00:35Z","closed_at":"2018-07-26T13:00:34Z","author_association":"NONE","body":"**Do you want to request a *feature* or report a *bug*?**\r\n\r\nbug\r\n\r\n**What is the current behavior?**\r\n\r\nI'm trying to add the mtouch argument `--registrar:static` to my xamarin iOS project but it results in the build errors from below. I would like to add the argument because it solves another build error after I've added the [Xamarin.Firebase.iOS.Analytics nuget package](https://github.com/xamarin/GoogleApisForiOSComponents/tree/master/Firebase.Analytics/component) to the project. The build is only failing for the simulator, builds for devices are fine.\r\n\r\n_Build errors:_\r\n```\r\n/Users/tobiasbuchholz/Work/PressMatrix/xamarin/PressMatrix/PressMatrix.UI.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/registrar.h(6579,53): error G9EBEE159: no type or protocol named 'MTKViewDelegate'\r\n    @interface MetalKit_Rx_MTKViewDelegateRx : NSObject<MTKViewDelegate> {\r\n                                                        ^ \r\n/Users/tobiasbuchholz/Work/PressMatrix/xamarin/PressMatrix/PressMatrix.UI.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/registrar.h(6585,25): error G5EC502AB: expected a type\r\n    -(void) drawInMTKView:(MTKView *)p0;\r\n                                   ^ \r\n/Users/tobiasbuchholz/Work/PressMatrix/xamarin/PressMatrix/PressMatrix.UI.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/registrar.h(6586,19): error G5EC502AB: expected a type\r\n    -(void) mtkView:(MTKView *)p0 drawableSizeWillChange:(CGSize)p1;\r\n                             ^ \r\n/Users/tobiasbuchholz/Work/PressMatrix/xamarin/PressMatrix/PressMatrix.UI.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/registrar.m(27402,99): error GC871EEFB: unknown type name 'MTKView'\r\n    static void native_to_managed_trampoline_494 (id self, SEL _cmd, MonoMethod **managed_method_ptr, MTKView * p0, uint32_t token_ref)\r\n                                                                                                      ^ \r\n/Users/tobiasbuchholz/Work/PressMatrix/xamarin/PressMatrix/PressMatrix.UI.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/registrar.m(27449,99): error GC871EEFB: unknown type name 'MTKView'\r\n    static void native_to_managed_trampoline_495 (id self, SEL _cmd, MonoMethod **managed_method_ptr, MTKView * p0, CGSize p1, uint32_t token_ref)\r\n```\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem**\r\n\r\n1. Create a xamarin iOS project (Single View App)\r\n2. Add ReactiveUI.Events package\r\n3. Use it in code so it get's included\r\n4. Add `--registrar:static` via Options -> iOS Build -> Additional mtouch arguments: \r\n5. Build\r\n\r\n**What is the expected behavior? What is the motivation / use case for changing the behavior?**\r\n\r\nThe build succeeds without any errrors.\r\n\r\n**Which versions of ReactiveUI, and which platform / OS are affected by this issue? Did this work in previous versions of ReativeUI? Please also test with the [latest stable](https://www.nuget.org/profiles/reactiveui) and [development snapshot](https://reactiveui.net/docs/getting-started/installation/nuget-packages/development-package-feed)**\r\n\r\nVersion: 8.3.1\r\nPlatform: iOS simulator only\r\n\r\nI didn't try other versions but I assume the behavior would be the same (see below).\r\n\r\n**Other information (e.g. stacktraces, related issues, suggestions how to fix)**\r\n\r\nI've also created an [issue](https://github.com/xamarin/xamarin-macios/issues/4422) at the xamarin-macios repository because at first I didn't know ReactiveUI.Events is causing the problem. Turns out they don't add proper include directive in the generated registrar code for MetalKit, which might be on purpose because Apple didn't ship the MetalKit framework for the simulator (see [this comment](https://github.com/xamarin/xamarin-macios/issues/4422#issuecomment-407408830)). \r\nSince ReactiveUI.Events looks at **all** EventHandlers for a plattform it apparently also generates code for MetalKit (see `MTKViewDelegateRx` in the build errros) which causes the build to fail for simulator builds.\r\n\r\nSo my suggestion would be, in case that's even possible, to exclude the code generation for MetalKit for simulator builds until it's confirmed whether the whole issue is a bug of Xamarin.iOS itself or not.\r\n"}}
{"actor":{"display_login":"glennawatson"}}