mlapp won't open (2017b)

9 views (last 30 days)
adam phillips
adam phillips on 10 Apr 2018
Answered: Michael on 25 Sep 2019
i am in the process of making an app using app designer. everything was fine. i quit matlab. next day, app designer will not open it, and there is no prj file in the directory. the app itself works fine when double clicked. But as it's not finished and i need to keep editing it, I need to be able edit it. at the very least, i need to get inside and see the code so that if I have to start over it doesn't have to be totally from scratch. i originally created it in 2017b. I have since updates to 2018a, but no help. the only difference it the error message when it won't open.
  1 Comment
Kojiro Saito
Kojiro Saito on 10 Apr 2018
Could you tell us what is the error message?

Sign in to comment.

Answers (6)

adam phillips
adam phillips on 11 Apr 2018
yes, when opened in app designer 2017b, the message is: "Error loading '[my file].mlapp'."
when opened in app designer 2018a, the message is: "Index exceeds array bounds."
i have no idea why the messages are different, or what that means.

Kojiro Saito
Kojiro Saito on 11 Apr 2018
Your mlapp file seems to be corrupted.
It's not documented work flow, but you can copy your mlapp file, rename it as a zip file and extract the zip. In matlab\document.xml, there are scripts which you've written in Code View of App Designer. You can edit this document.xml and compress the whole folder as a zip and rename it as mlapp file.
For reference, please see this link, especially Editing MLAPP files outside AppDesigner section.
  1 Comment
Hank on 24 Sep 2018
Kojiro, I've had a similar issue to Adam, in AppDesigner R2018a. My error message said 'Dot indexing is not allowed for variables of this type'. These both sound like standard syntax errors. It seems outrageous that app designer would refuse to open just because I haven't caught all my mistakes yet.
I was forced to rewrite the whole script, fortunately with the guidance of the code in document.xml.
By the way, I attempted copying the script from document.xml into my own m file. Again, I know this is undocumented, but when I run the app code, it complains the the method :all: is not implemented. Why does this occur and do you know a way around it?

Sign in to comment.

adam phillips
adam phillips on 13 Apr 2018
thank you for the tip. I'm going to try it today!
  1 Comment
I am having a similar issue, can you please tell me if the proposed solution worked ok? Thanks

Sign in to comment.

adam phillips
adam phillips on 18 Jun 2018
it sort of worked. I was able to see the code, but could not find any error. But, i was able to copy and paste the code and make a new app.

Raghu S
Raghu S on 27 Jul 2018
Hey, I am facing the same issue and followed the same procedure. But, even after that getting the same error. Is der any possibility that app designer layer can be reconstructed from the code extracted from .xml?

Michael on 25 Sep 2019
This is a good thread. It is very disturbing that the MLAPP file can become corrupted but it is very helpful to know that the file is just a ZIP file and matlab\document.xml can be extracted and the code can be saved and pasted into a backup MLAPP file to recover some of the project.
It would be helpful if The Mathworks had an autosave feature to protect against this stort of very frustrating problem.





Community Treasure Hunt

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

Start Hunting!