Will my App Designer app be compatible in previous and future releases?

22 ビュー (過去 30 日間)
I have several scripts that I am thinking about converting into App Designer Apps. I know that R2018a introduced a change where you can export apps to previous releases. Will I have to deal with any incompatibilities or errors if I have to use an app on previous releases?
I also want to use my app to interact with Simulink models in previous releases by updating custom blocks. Will I be able to do this without losing functionality when I export to the previous releases?

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 7 月 12 日
編集済み: MathWorks Support Team 2024 年 7 月 12 日
Running and Editing Apps in a Newer Release
Generally, applications developed in a given release are expected to work in newer releases as well.
If you open an app for editing that was created in a previous release, App Designer updates the app and displays a message such as this one:
This app was created in MATLAB R2023a. The generated code has been updated for R2023b.
Save the app with "Save As". The saved app is now compatible with the newer release.
If any incompatibilities are introduced, the Code Compatibility Analyzer is a useful tool that you can use to identify potential compatibility issues in your existing code when you update MATLAB: https://www.mathworks.com/help/matlab/matlab_prog/matlab-code-compatibility-report.html
Running Apps in an Older Release
Whether an app created in a newer release will run in a previous release depends on the components and functionalities used in the app:
  • If the newer app uses a new component or functionality that the older release does not yet support, there will be an error when trying to run it in the older release.
  • If the newer app only uses features that are supported by the older MATLAB release, the app should be runnable in that release of MATLAB.
A simple way to ensure compatibility when running is to create apps as web apps: https://www.mathworks.com/help/compiler/webapps/create-and-deploy-a-web-app.html
Web apps are created against one version of MATLAB and that version of MATLAB is on the server. End users can access Web Apps (including new features) regardless of which version of MATLAB they are running on their personal machine.
Editing Apps in an Older Release
If you try to edit an app in an older release of App Designer, any incompatible functionality (components that do not exist in the previous release) will be removed. To make the app compatible with an older release, follow the steps below:
1) Right-click the .mlapp file and select "Open".
2) App Designer will automatically detect the incompatible code and remove it. You will a message such as this one:
This app was created in MATLAB R2019a. The app has been updated to make it compatible with R2018b.
Some functionality might be lost, or you might see some unexpected errors.
3) Save the app with "Save As". The saved app is now compatible with the older release.
For example, if you create an app in R2019a or later that contains an image component ("uiimage"), this component will be removed when you open the app in R2018b or earlier. This happens because releases prior to R2019a do not support "uiimage".
If you try to edit a newer app in a release that is older than R2018a, you might first need to export it as explained in the following section.
Export Apps for Editing with R2017b, R2017a or R2016b
Starting in R2018a, the apps you save in App Designer have a new format. This new file format might impact your ability to edit newer apps in releases R2017b and older, but it has no impact on your ability to run them in previous releases.
To export your app to enable editing in releases R2017b or older, use "Save Copy As". The details of how to do so are described on the following page: https://www.mathworks.com/help/matlab/creating_guis/compatibility-between-different-releases-of-app-designer.html
Saving a copy of an app to R2016a is not in the list of "Save Copy As". It is still supported but requires a patch to be installed in order to work. You will need this patch if you want to edit the app in App Designer in R2016a: https://www.mathworks.com/support/bugreports/1397819
Performing "Save Copy As" is not an option when using R2023a Update 5 (or earlier) and R2023b Update 1 (or earlier). This is a known issue that was resolved in R2023a Update 6, R2023b Update 2, and is resolved in R2024a.
With Simulink
When using an app to interact with Simulink, it is important to ensure that both the App Designer and Simulink functionalities are supported on the releases being used. For example, if you are changing a specific property of a block, you will want to check that the property and the accessing function exist and are supported on all of the releases you are using. Then, you can place any necessary code changes that resolve incompatibilities into a callback function for an app component that is supported across all the releases (like a "uibutton"). Being careful about coding the app in this way should eliminate any incompatibilities between the releases.
There currently is no support for Web Apps to interact with previous versions of Simulink.

その他の回答 (1 件)

Vishnu Vardhan
Vishnu Vardhan 2019 年 6 月 21 日
Hi Sampath
There is no problem in running the new app in previous versions but if you want to edit in the previous version then it throws an error. There is also a way to overcome that error.
This link might help you to overcome that error.
  1 件のコメント
Andrew Scheich
Andrew Scheich 2021 年 4 月 16 日
Hi Vishnu,
I'm having a slightly different problem where an app created in 2017a runs just fine in 2017a, but when it's opened in 2020a it doesn't want to run correctly. I'm referencing a database to load files from and it will prompt me saying no files found when they're selected. Any ideas would be helpful?
Thanks,
Andrew

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by