App Designer Stops Functioning when adding components after GUIDE migration

조회 수: 15 (최근 30일)
Zachary Eisner
Zachary Eisner 2021년 3월 1일
댓글: Lee 2022년 10월 20일
I've recenly migrated a MATLAB app from GUIDE to app deisgner. The migration worked well, but the app is now throwing errors after adding new components on a seperate tab. Nothing else about the code has been changed. There error message is occurs during my Opening Function:
function ecgigui2_OpeningFcn(app, varargin)
% Create GUIDE-style callback args - Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app); %#ok<ASGLU>
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to ecgigui2 (see VARARGIN)
% Choose default command line output for ecgigui2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
end
It reads:
Unrecognized method, property, or field 'Type' for class 'matlab.graphics.shape.internal.ScribePeer'.
If I delete the added components, the app works fine again. Please help!
  댓글 수: 4
Allen
Allen 2021년 3월 11일
Akanksha,
I think that the issue has something to do with the change of the primary data structure changing from handles to app and then occurs during the convertToGUIDECallbackArguments(app) function. Other than taking the long route to resolving the issue and manually rebuilding the application with AppDesigner, take a look at the link below for a few extra steps that you might take to get your new app working. As I mentioned previously, I have not had much success at using the migration tool with my old apps.
Akanksha  Mishra
Akanksha Mishra 2021년 3월 12일
Hi @Allen thanks for your time to reply to my question.
I coulndt find anything new/helpful on the link page.
Yes issue is in the Conversion function as you pointed but isnt this absolutely unreasonable ? I mean to say that once guide tool is migrated to app, obviously developer may want to add new components to it. So not handling that change is very unreasonable for the migration tool. This is ofcourse only if I am understanding the issue correctly. But looking at the original question by @Zachary Eisner in this thread tells me same. As i am facing exactly similr issue.
@Zachary Eisner Did you find a solution for this problem ?

댓글을 달려면 로그인하십시오.

답변 (2개)

Akanksha  Mishra
Akanksha Mishra 2021년 3월 11일
I am facing exactly same errors for my migrated app. Kindly provide solution this someone please.

AZ
AZ 2021년 5월 7일
This error is indicative of a bug in MATLAB. In order to work around this bug, add the following three lines of code before convertToGUIDECallbackArguments in the Opening Function (also called a ‘StartupFcn’ in App Designer).
  • Note 1: Ensure that the first line of code below has the correct name of your app’s UIFigure (‘app.UIFigure’ could be named ‘app.figure1’ in your app).
  • Note 2: These lines of code only need to be added to the top of the Opening Function. They don't need to be added before every single call to convertToGUIDECallbackArguments in the app.
This is the code to copy/paste into the app:
allAxes = findall(app.UIFigure, 'Type', 'axes');
arrayfun(@(ax) disableDefaultInteractivity(ax), allAxes)
oncleanup = onCleanup(@() arrayfun(@(ax) enableDefaultInteractivity(ax), allAxes));
  댓글 수: 1
Lee
Lee 2022년 10월 20일
I am now suffering this exact problem in Matlab 2020b. Thankfully I found this bugfix - has this been properly resolved in a more recent release?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by