9

I only just noticed this today - Calculator is gone.

Is this an "improvement" with 10.13.5 which I installed just the other day, or did I break something?

I did notice Stocks appear in there as if by magic the other day - something I'm never ever going to need, but I hadn't spotted Calculator's disappearance until now.

Checked my partner's machine - same OS, very similar machine - lot & lots of widgets...

So, maybe the question becomes, 'where do they live & why can't my machine find them?'

Late edit:
I've found the calculator app, in
/System/Library/Frameworks/NotificationCenter.framework/PlugIns/com.apple.ncplugin.calculator.appex
so now I need to figure out a way to get the Notification Centre to recognise it again.

Per comments...
defaults read com.apple.notificationcenterui
gives

{
    TodayView =     {
        NoContent =         (
            "com.apple.reminders.RemindersNC"
        );
        keyWidget = "com.apple.ncplugin.calculator";
        order =         (
            "com.apple.reminders.RemindersNC",
            "com.apple.iTunes.today.TodayExtension",
            "com.apple.iCal.CalendarNC",
            "com.apple.ncplugin.weather",
            "com.parallels.desktop.console.Resource-Monitor",
            "com.apple.ncplugin.stocks"
        );
        preferences =         {
            "com.apple.nc.disclosures" =             {
                enabled = 1;
            };
            "com.apple.nc.today.date" =             {
                enabled = 1;
            };
            "com.apple.nc.today.dnd" =             {
                enabled = 1;
            };
            "com.apple.nc.today.summary" =             {
                enabled = 1;
            };
            "com.apple.nc.tomorrow.summary" =             {
                enabled = 1;
            };
        };
    };
    bannerTime = 5;
    "last-messagetrace-stamp" = "551957496.077987";

so they're missing there. Does that mean there's a defaults write to put them back?

Tetsujin
  • 115,663
  • +1 Good question. In my El Capitan install, the calculator I had there normally suddenly was gone and I had to add it back (at least I could). An update perhaps? – Allan Jun 21 '18 at 18:19
  • 1
    For what it's worth, it's still here in Mojave 10.14 beta 2 so I don't think it was removed intentionally. – grg Jun 21 '18 at 18:19
  • I just checked my partner's machine - many more widgets, same OS, very similar machine. Added to question. – Tetsujin Jun 21 '18 at 18:30
  • You can use the old in Dashboard. – user7886229 Jun 21 '18 at 20:33
  • 2
    Dashboard is & always was useless; Can't see what you're working on while it's open & as soon as you touch anything it closes again. – Tetsujin Jun 22 '18 at 16:21
  • Hmm, just noticed this question. It's definitely not a 10.13.5 thing (i.e. I'm running that on the iMac Pro and the Calculator widget works fine). So, would I be correct in assuming it's still missing when you're booted in Safe Mode, but that it's fine in another user account, just not in yours? (If you don't have another user account, might be worth creating one just to test). – Monomeeth Jun 26 '18 at 08:43
  • It's there on another admin account [can't test safe right now, too much running] & is there on my Partner's machine too. Somewhere in my clone/restore/overlay brand new OS, it's got lost. I'm hoping I don't have to do yet another OS overlay to get it back. – Tetsujin Jun 26 '18 at 08:54
  • What about a simple reinstall of the OS? – user7886229 Jun 26 '18 at 19:57
  • When you have a moment, could you please post the output of defaults read com.apple.notificationcenterui? Thank you. – Doc G. Jun 28 '18 at 22:12
  • What about disabling SIP and renaming it? – user7886229 Jun 29 '18 at 20:35

3 Answers3

8

When it comes to troubleshooting Notification Centre widgets, there are a number of options you can try.

1. Use the Edit option within Notification Centre

This is really the first thing to try. Refer to Seamus' answer for the steps involved.

2. Check the Extensions preference pane

In summary:

  1. Go to Apple > System Preferences... > Extensions
  2. OPTIONAL: If you're having issues with 3rd party extensions, select the All option in the lefthand pane and then check the righthand side to enable any that aren't activated
  3. Select the Today option in the lefthand pane
  4. Now check the right-hand side list to confirm the widget(s) are enabled (if not, tick the relevant checkbox(es)
  5. Exit System Preferences
  6. Check your Notification Centre to see if the Widget(s) are active and/or functioning properly

3. Test another User account

  1. Log in to another user account to test whether the Notification Centre (and any Widgets you're having problems with) are working properly. If you don't have another user account, you can log into the Guest account or create a new temporary account at Apple > System Preferences... > Users & Groups
    • If the Notification Centre / Widgets work fine in the other Account, then try 4, 5, 6, 7, 8, 9 and 10 below
    • If the Notification Centre / Widgets do not work fine in the other Account, then use macOS Recovery to Reinstall macOS (NOTE: Ensure you have a full backup prior to doing this). Likewise, you can use macOS Recovery to restore from a Time Machine backup that was made prior to problems with Notification Centre (NOTE: Ensure you have a full current backup prior to doing this, so that you don't lose any recent documents, emails, photos, etc).

4. Use Widget Simulator to add it back again

  1. Go to /System/Library/Frameworks/NotificationCenter.framework/Resources/
  2. Launch the Widget Simulator
  3. Now go to /System/Library/Frameworks/NotificationCenter.framework/PlugIns/
  4. Drag and drop the com.apple.ncplugin.calculator.appex file onto the Widget Simulator icon in the Dock
  5. This should open the widget in a Simulator window
  6. Click on the green + button:

enter image description here

  1. Now check to see if the Calculator widget is back in your Notification Centre (or available to add back again)

5. If present, delete any relevant .plist files

NOTE: If you've tested another User Account and the Notification Centre / Widget is not working fine in that account, then do not proceed with this option.

If macOS has created a .plist file for a specific Widget you're having problems with, then delete it. To check this you need to access the relevant Notification Centre Plugin container for the user account in question. Using the Calculator widget as an example, you would go to:

~/Library/Containers/com.apple.ncplugin.calculator/Data/Library/Preferences

If you see a .plist file for the specific widget (e.g. com.apple.ncplugin.calculator.plist and/or com.apple.calculator.plist), then delete it and restart your Mac.

6. Swap the specific widget .appex file

Grab a known good copy of your widget from a Time Machine backup or another computer. In this case (i.e. a macOS High Sierra installation), the Calculator widget can even be replaced with one from macOS Sierra.

To do this:

  1. On another Mac or within a Time Machine backup, navigate to: /System/Library/Frameworks/NotificationCenter.framework/PlugIns/
  2. Copy the com.apple.ncplugin.calculator.appex file representing the Calculator widget
  3. Now past this into the problem Mac at the same location: /System/Library/Frameworks/NotificationCenter.framework/PlugIns/

NOTE: To do this you will need to temporarily disable System Integrity Protection (SIP) on the Mac you're having problems with.

7. Sign out of and then back into iCloud

I guess the heading says it all. Go to Apple > System Preferences... > iCloud and sign out. Once you're signed out, then sign back in again.

8. Force a Spotlight reindex

There are various ways to do this. The easiest way is to:

  1. Go to Apple > System Preferences > Spotlight
  2. Select the Privacy tab
  3. Drag your boot volume into the window
  4. Wait a few minutes
  5. Remove your boot volume so that it's no longer listed in the window
  6. Exit System Preferences

NOTE: Reindexing your boot volume can take a long time. How long depends on the size of your drive and how much data is stored on it.

9. Reset your password and create a new Keychain

Follow the steps here to reset your password first and then to create a new Keychain.

10. Create a new User account and migrate your data into that one

Obviously this will take a few hours, but this will definitely solve the problem (assuming that when you tested another user account at 3 above it worked fine). Essentially you're creating a new account and migrating all your data to that one instead.

Monomeeth
  • 64,558
  • hmm... no werky :/ Says it can't find the file [for all 3 in there] when quite plainly they are right there. Same thing works just fine on another machine. SIP is in my way, will try without it & report back... – Tetsujin Jun 26 '18 at 09:32
  • Hmm, SIP shouldn't stop you from doing this, so I'd be surprised if disabling it had an impact. Just to clarify, are you saying you can't even open the plugin in the Widget Simulator, or that you can open it but clicking on the green plus sign results in the error message? – Monomeeth Jun 26 '18 at 10:56
  • It stopped me swapping in new versions from the other machine. Since disabling it I've tried new versions & also versions on the desktop - 'can't find' is still the issue. https://i.stack.imgur.com/818u1.png – Tetsujin Jun 26 '18 at 11:04
  • Ah, yep, SIP would stop you adding/swapping them, but shouldn't affect your ability to use the Simulator etc. So, is the Calculator widget missing from the list in System Preferences > Extensions > Today? If it's there, is it enabled? – Monomeeth Jun 26 '18 at 11:26
  • It's missing. That was the first place I checked [user pref, I managed to find that one... buried Frameworks not so easy ;) It's there, it won't run with Widget Sim. Even copied the entire Framework from another machine. Something's just not registering properly & I cannot figure out what. I'm tempted to lay another combo updater over it again, or even the whole OS... nuisance as I'm time-constrained on actual work I need to do ;) – Tetsujin Jun 26 '18 at 11:41
  • Wait what?! There’s a Notification Center Widget Simulator preinstalled on the mac?! Never saw this before. So cool. – user7886229 Jun 26 '18 at 14:36
  • Just so you know, I've just reworked my answer to include a whole range of options that I think will be helpful to other users searching for answers. Not sure how many of these you've already tried, but hopefully there's something in there that helps! As an aside, the issue you're having (i.e. that it can't find the file) is something I've only seen when developers haven't signed their widgets properly, which clearly isn't the case here. :( Anyway, if I can think of anything else I'll be sure to add it! – Monomeeth Jun 27 '18 at 12:43
  • I've done everything up to 8, but I have a deep paranoia about losing my Keychain - it goes back to 2002, in an unbroken line. It remembers things for me I've forgotten I even needed to remember ;) I checked my clone from before I re-layed the OS to restore my missing Recovery partition & it's fine there, so I'm currently re-cloning from that. I'll let you know how it goes. [I tried the combo updater again, btw, no joy] – Tetsujin Jun 29 '18 at 12:34
  • Re-clone no fix:( Works on the clone on HFS+, but not once I clone that back to the regular boot drive, which is APFS. – Tetsujin Jun 29 '18 at 16:23
  • Fair enough re the Keychain, it can be pretty nerve-wracking mucking around with that! :) As for the combo updater, yeah, didn't think that would work. It would probably have been the solution if the widget also wasn't working in your other user accounts, but not in this case. I'm really quite interested in this issue because getting the error that you couldn't open the widget because it can't be found is, well, it just doesn't make sense (maybe for a 3rd party widget, but not for an Apple widget). – Monomeeth Jun 30 '18 at 05:31
  • At present, the only other solution I can think of is not something I'll be adding to my answer - just too risky to document it here (as it involves modifying your user account). You never know what could go wrong! Maybe option 10 is the way to go, but if you did that I think it'd be great if you could still keep the existing account (after removing all your user data) so that we have a way of testing and finding the solution. But that's my curiosity getting the better of me! Anyway, if I think of anything else I'll update my answer! :) – Monomeeth Jun 30 '18 at 05:31
  • Yes, the 'path not found' error is totally bemusing, especially as it continues to give that error wherever I move the file. SIP is off at the moment to make life easier until I get this sorted, but I'm getting very tempted to re-clone this to HFS+ & be done with it. I've still also got the Time Machine 'could not create a snapshot' error too. It works if I thin to only the last snapshot, but then fails again a day later. – Tetsujin Jun 30 '18 at 10:38
  • I'm currently making a new clone of the existing 'no werky' drive as it stands. If that works once it's on HFS, then... we'll have an even deeper mystery, but perhaps one we can lay at the feet of APFS. – Tetsujin Jun 30 '18 at 10:54
  • OK, I'm not really sure what conclusion I can come to, except there's "something wrong with APFS"... Clone 'broken' drive to HFS, works fine. Clone it back to fresh APFS, broken. Reformat APFS to HFS & clone back again, works. – Tetsujin Jul 01 '18 at 10:29
  • I wonder what'd happen if you did a clean installation of High Sierra on an APFS volume and then, assuming the Calculator widget works, copying that to your usual volume? I also wonder whether the type of APFS format (i.e. encrypted, case-sensitive, etc) was at play here? Anyway, you're probably at the point that you don't care anymore as long as it works! LOL I certainly wouldn't blame you. It'll be interesting to see how well Mojave pans out. So far it's doing a lot better in the betas than the last few versions of macOS did. Hopefully that signifies a renewed focus at Apple on the Mac! – Monomeeth Jul 02 '18 at 06:09
  • Yeah, right now I'll just take 'it works' tbh. It would be marvellous if Mojave pulls things back together again, because for me, the last 2 have been... pants:/ breaking more than they add. I might try APFS again at Mojave, see what happens. btw, the invisible internet points are all yours, for the effort you went to & its canonical value, even if we reached no real conclusion. – Tetsujin Jul 02 '18 at 10:04
2
  1. Open the Notification Center enter image description here

  2. Click on the EDIT button at the bottom of the panel. Several "Items" will appear to the right of the panel, including the "Calculator" item. enter image description here

  3. Click the + icon the the right of the Calculator. The Calculator is moved into the main panel of the Notification Center. enter image description here

  4. Click the Done button at the bottom of the panel. The options disappear from the panel, and the Calculator remains in the Notification Center panel. enter image description here

Seamus
  • 4,547
1

Not much of an answer, but I eventually solved both this issue & also Recurring Volume damage + Time Machine issues by cloning the drive, reformatting to HFS+ & cloning back again.

No amount of messing with APFS would fix it.

But see Monomeeth's answer here for a great troubleshooting guide.

Tetsujin
  • 115,663
  • Late Note: Apple saw fit to automatically re-format back to APFS ... & both issues returned immediately. – Tetsujin Jul 26 '18 at 13:00