Why am I receiving an "Error using can.validateCANdbFile: Unable to find DBC-file" when executing my compiled App Designer standalone application?

3 views (last 30 days)
I've written a GUI application in App Designer that uses the Vehicle Network Toolbox and several CAN database (.dbc) files. This application runs smoothly and works as expected when running it locally in MATLAB.
I would like to package and distribute my application to other users as a standalone application using MATLAB Compiler. Once I package and compile my app, I'm able to run the standalone executable (.exe). The app opens up and appears to be working, but when I attempt to interact with it, I receive the following error message:
Error using can.validateCANdbFile
Unable to find DBC-file.
Error in canDatabase (line 24)
Error in app/PlotButtonPushed (line 119)
Error in appdesigner.internal.service.AppManagementService/executeCallback (line 138)
Error in matlab.apps.AppBase>@(source,event)executeCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 63)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback
Error while evaluating Button PrivateButtonPushedFcn.
How can I resolve this error and make my compiled standalone app work as expected?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Sep 2022
This error is appearing because the referenced .dbc files in the application were not included as dependencies in the packaged application.
To resolve this, you should manually add any necessary files and dependencies for your project under the
"Files required for your application to run" 
section in the Application Compiler before packaging your application.
Once these dependencies have been included, your compiled application should function as expected as it will be able to locate the referenced files.
 

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!