Save button disabled when editing an App Designer App

21 次查看(过去 30 天)
I'm having a seemingly bizarre issue with an Application I'm making in App Designer. I have multiple .mlapp application files that I'm working on, most work normally. However, I have one file that when I'm working on it, the 'Save' button in App Designer is always grey. If I make a change, the * symbol will appear next to the filename in the tab, but the Save button remains greyed out.
If I close the file, it prompts me if I want to save, and the files saves correctly when I press Save in that dialog. This is what I'm using as a work around right now. However, that means when I'm developing / debugging this App I have to close the App, Save, wait for it to finish closing, then open it again and wait for it to finish opening. This adds a lot of delay in my development, particularly when I just need to make small tweaks / edits to the code and I have to close and re-open for each and every one to test them.
It's only in this one file where it happens, none of the others. Also, my application appears to run fine - it's working as expected.
What could be causing this and how can I fix it - or have I encountered some weird bug in MATLAB?
I also noticed, and can't help but think it may have something to do with it, I keep getting the following warning text while I'm in the file:
Warning: JSON incompatible value has been used.
In matlab.ui.internal/DesignTimeWebUIContainerController/appendInspectorInfo (line 291)
In matlab.ui.internal/DesignTimeWebUIContainerController/initializeInspectorPropertyView (line 251)
In matlab.ui.internal/DesignTimeWebUIContainerController/populateView (line 83)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 37)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createComponent (line 142)
In appdesigner.internal.componentmodel/DesignTimeComponentFactory/createModel (line 17)
In appdesigner.internal.componentcontroller/DesignTimeGridLayoutController/populateView (line 48)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 37)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createComponent (line 142)
In appdesigner.internal.componentmodel/DesignTimeComponentFactory/createModel (line 17)
In matlab.ui.internal/DesignTimeGbtParentingController/populateView (line 27)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 37)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createComponent (line 142)
In appdesigner.internal.componentmodel/DesignTimeComponentFactory/createModel (line 17)
In matlab.ui.internal/DesignTimeGbtParentingController/populateView (line 27)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 37)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createComponent (line 142)
In appdesigner.internal.componentmodel/DesignTimeComponentFactory/createModel (line 17)
In appdesigner.internal.componentcontroller/DesignTimeGridLayoutController/populateView (line 48)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 37)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createComponent (line 142)
In appdesigner.internal.componentmodel/DesignTimeComponentFactory/createModel (line 17)
In matlab.ui.internal/DesignTimeGbtParentingController/populateView (line 27)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 37)
In appdesigner.internal.componentmodel.DesignTimeComponentFactory.createComponent (line 142)
In appdesigner.internal.componentmodel/DesignTimeComponentFactory/createModel (line 17)
UPDATE
The save button did activate one time. It happened when I stepped away from my PC for a long time and came back. Suddenly, the save button was enabled. Also, I noticed that a custom component I was using was (seemingly) not fully loading in App Designer. At the same time I noticed the save button was enabled, I noticed that the component had finally completely loaded. This is a span of many hours, so this doesn't solve my problem, however. It's strange, because when I actually run the App everything loads fine, loads quick even, no issues.. .but in App Designer itself, my custom component hangs and takes forever to load. I will look into my component to see why it's taking so long to load (it's a very simple and should be straightforward component, so I really don't know what is making it take so long... but obviously something is wrong with it.
I'm trying to delete this component in order to otherwise work normally on the App, but it also won't let me delete the component while it's trying to load it in App Designer. This is very frustrating. I will probably have to wait hours to do anymore productive work on this.

采纳的回答

Captain Karnage
Captain Karnage 2023-3-13
I'm not sure what went wrong, but a link to a custom component I had "broke". I think it had to do with the fact that I had an OpenFcn callback at one point and then I removed it. I believe that for some reason, even though I removed it in the custom component and repackaged the custom component, the calling App was still trying to run an OpenFcn calback and took a long, long time before it decided to time out and return control to App Designer.
Since I couldn't delete it within App Designer, I had to take the following steps:
  1. Close App Designer
  2. Rename my custom component file (I just added "_backup" to the name)
  3. Open the App using the custom component
  4. This cause App Designer to detect that the custom component is missing, and if you select "Open Anyway" it deletes all the references to that component from the Apps code
  5. Save the App
  6. Close the App (not sure if this is necessary, but did as a check)
  7. ReOpen the App
  8. Add the updated custom component back in
Now my app, and the associated custom component, load just fine.

更多回答(1 个)

chrisw23
chrisw23 2023-2-8
Save a copy of this file within appdesigner and check if the behaviour can also been seen running the copied mlapp file.
  2 个评论
Captain Karnage
Captain Karnage 2023-2-8
That's the thing... I can't do that. Save, and the associated drop down in the ribbon menu are greyed out and not clickable. The only way I can save from within App Designer is by closing it, and hitting save on the dialog that pops up. Save a copy or Save As are not options in that dialog.
Are there any alternative ways to save a copy from within App Designer?
Captain Karnage
Captain Karnage 2023-2-8
Also, there are no errors in the code, it runs fine. There are only 3 warnings, and they are all for unused variables. I know certain errors will prevent saving, but not the case here.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by