matt-curtis / Fluid-for-Sketch

[Sketch Plugin] Sketch-flavored Auto Layout-like Constraints
2.38k stars 73 forks source link

Plugin not working with Sketch 41 #109

Closed k0mrad closed 7 years ago

k0mrad commented 7 years ago

The Update Layout button and Preview are no longer working with the latest Sketch update # #

matt-curtis commented 7 years ago

Can you tell me in what instances 'Update Layout' is not working? I can't get the same issue - it still works. Preview is not working, though.

moxamax commented 7 years ago

Fluid crashs when click Update Layout:

Exception Name: NSInvalidArgumentException
Description: -[MSTextLayer layoutManager]: unrecognized selector sent to instance 0x7f81dae0b510
User Info: (null)

0   CoreFoundation                      0x00007fffb66cd7bb __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x00007fffcae3aa2a objc_exception_throw + 48
2   CoreFoundation                      0x00007fffb674dd84 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3   CoreFoundation                      0x00007fffb6640fc3 ___forwarding___ + 1059
4   CoreFoundation                      0x00007fffb6640b18 _CF_forwarding_prep_0 + 120
5   MCSketchPluginFramework             0x000000010f0ed08a Sketch_GetTextSize + 58
6   MCSketchPluginFramework             0x000000010f0ecfca Sketch_GetTextHeight + 186
7   Fluid                               0x0000000115ad2818 __70-[MCSLayerLinkedView applyConstraints:didChangeWidth:didChangeHeight:]_block_invoke.78 + 232
8   Fluid                               0x0000000115acf99a -[MCSLayerLinkedView applyConstraints:didChangeWidth:didChangeHeight:] + 2426
9   Fluid                               0x0000000115acdd5b +[MCSLayerConstraintsSimulator buildLinkedLayerViewHiearchyInCanvasView:superlayer:fromLayers:allLinkedLayersArray:] + 987
10  Fluid                               0x0000000115acd8da +[MCSLayerConstraintsSimulator buildLinkedLayerViewHiearchyInCanvasView:superlayer:fromLayers:] + 186
11  Fluid                               0x0000000115acddf1 +[MCSLayerConstraintsSimulator buildLinkedLayerViewHiearchyInCanvasView:superlayer:fromLayers:allLinkedLayersArray:] + 1137
12  Fluid                               0x0000000115acd8da +[MCSLayerConstraintsSimulator buildLinkedLayerViewHiearchyInCanvasView:superlayer:fromLayers:] + 186
13  Fluid                               0x0000000115ace0b8 +[MCSLayerConstraintsSimulator applySimulationOfConstraintsToLayers:inCanvasWithSize:detachSymbols:] + 296
14  Fluid                               0x0000000115ae4777 -[MCFluidPluginController updateLayoutWithPrompt:] + 903
15  Fluid                               0x0000000115ae3f3a -[MCFluidPluginController actionBar:indexWasClicked:] + 154
16  Fluid                               0x0000000115ae25cb -[MCSActionBarWindow segmentedControlClicked:] + 139
17  libsystem_trace.dylib               0x00007fffcb94803d _os_activity_initiate + 61
18  AppKit                              0x00007fffb49ed4e7 -[NSApplication(NSResponder) sendAction:to:from:] + 456
19  AppKit                              0x00007fffb453d245 -[NSControl sendAction:to:] + 86
20  AppKit                              0x00007fffb453d16d __26-[NSCell _sendActionFrom:]_block_invoke + 136
21  libsystem_trace.dylib               0x00007fffcb94803d _os_activity_initiate + 61
22  AppKit                              0x00007fffb453d0c5 -[NSCell _sendActionFrom:] + 128
23  AppKit                              0x00007fffb453d039 -[NSSegmentedCell _sendActionFrom:] + 105
24  libsystem_trace.dylib               0x00007fffcb94803d _os_activity_initiate + 61
25  AppKit                              0x00007fffb453ba58 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2481
26  AppKit                              0x00007fffb453ad2f -[NSSegmentedCell trackMouse:inRect:ofView:untilMouseUp:] + 995
27  AppKit                              0x00007fffb453a4c8 -[NSControl mouseDown:] + 832
28  AppKit                              0x00007fffb4b4d73d -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 6341
29  AppKit                              0x00007fffb4b49f8c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 1942
30  AppKit                              0x00007fffb4b4942a -[NSWindow(NSEventRouting) sendEvent:] + 541
31  AppKit                              0x00007fffb49e9bf5 -[NSApplication(NSEvent) sendEvent:] + 1145
32  AppKit                              0x00007fffb42d0009 -[NSApplication run] + 1002
33  AppKit                              0x00007fffb429aa8a NSApplicationMain + 1237
34  libdyld.dylib                       0x00007fffcb716255 start + 1
35  ???                                 0x0000000000000001 0x0 + 1
k0mrad commented 7 years ago

strangely enough, today it works for me. Yesterday it was completely unresponsive.

andrejilderda commented 7 years ago

Fluid doesn't work for me on v.41 also (it does not crash the app though). When I trigger 'update layout' I see this error appear in the log:

Sketch[534]: Exception: -[MSTextLayer layoutManager]: unrecognized selector sent to instance 0x7fee991d4f30
Update Layout (Sketch Plugin)[534]: -[MSTextLayer layoutManager]: unrecognized selector sent to instance 0x7fee991d4f30

👆Does that help?

matt-curtis commented 7 years ago

Seems like it's breaking on text layers. WIP!

moxamax commented 7 years ago

Any news on this bug? Fluid is so productive. I can't work without it :(

andrejilderda commented 7 years ago

This is holding me back from updating, so I'm also hoping for an update. :) I must say that I can't really track down why some text layers are updated and others aren't...

moxamax commented 7 years ago

I noticed if a "Fixed Width" or "Pinning Right" constraint was applied on a text layer, error will occur while updating layout:

default 11:29:34.745404 +0800   Sketch  -[MSTextLayer layoutManager]: unrecognized selector sent to instance 0x7f9f61a4cac0
default 11:29:34.746161 +0800   Sketch  subsystem: com.apple.AppKit, category: General, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 0, enable_private_data: 0
error   11:29:34.746211 +0800   Sketch  <private>
error   11:29:34.755080 +0800   Sketch  <private>

However, other constraints (align, fixed height, or pinning) won't break layout updating. Fluid works fine if disable fixed width and pinning right constraints on text layers for now.

I'm using macOS 10.12.1 & Sketch 41.1

matt-curtis commented 7 years ago

@moxamax Very helpful, thank you!

matt-curtis commented 7 years ago

So... it appears BH/Sketch team has changed the backing implementation of MSTextLayer, and I can't (yet?) find a way to easily grab the text height. I may have to scrap this part of the functionality. This also breaks my Sketch Highlighter plugin...nice.

matt-curtis commented 7 years ago

I am disabling this feature (text layer auto-sizing) in subsequent releases until an alternative API to accomplish this is found.

matt-curtis commented 7 years ago

Closing this in favor of #111.