Simulink Support Package For Android Devices --> Hardware Configuration: Building TestApp fails
23 views (last 30 days)
Show older comments
Effesian on 12 Jun 2022
Commented: Sutanu Maiti on 1 Jul 2022
I want to install the Simulink support package for Android devices and followed the steps in the configuration menu. I got stuck at step: "Verify configuration of your Android device". Here a shortened version of the error message:
A problem occurred configuring root project 'TestApp'. > Could not resolve all artifacts for configuration ':classpath'. > Could not resolve com.google.flatbuffers:flatbuffers-java:1.12.0. Required by: project : > com.android.tools.build:gradle:4.2.0 > Could not resolve com.google.flatbuffers:flatbuffers-java:1.12.0.
My Matlab installation: MATLAB Version: 22.214.171.1243467 (R2021b) Update 3
When running in the MATLAB command line:
AndroidStudioWorkflowValidator with properties:
AndroidStudioPath: 'C:\Program Files\Android\Android Studio'
JavaJDKPath: 'C:\Program Files\Android\Android Studio\jre'
Any idea what is going wrong? Thanks!
Sutanu Maiti on 13 Jun 2022
Please install the build tools from Android Studio’s SDK manager as shown in the below image :
And the same goes for platform tools and others as mentioned in the Hardware Setup Page. Then, On the Android Hardware Setup Screen First page, please select the ‘Latest Version’ option and proceed further.
Sutanu Maiti on 1 Jul 2022
Even if the 'Test Connection' on the last Hardware Setup screen fails, you can still deploy models on your phone as a standalone application. The only thing you will be missing is the 'Monitor & Tune' and 'Connected IO' features because that requires active communication between MATLAB and the phone.
Just Check if 'prefdir' has the folder 'MWAndroidDeviceInfo' created and inside that folder 'AndroidToolsInfo.json' file and 'wrapper' folder is created or not. To go to 'prefdir' just execute below command in MATLAB:
If the mentioned json file and the 'wrapper' folder are present, then you are good at deploying any model.
Poont to be noted:
You need an active internet connection on your host computer while building the 'TestApp' for the very first succesful build. Because gradle synchronizes its tools during the first build.
Once the first build is done, you may create a WiFi hotspot from your phone and connect your pc to that hotspot if possible. That will make both the devices on the same network. And you can use the 'Monitor and Tune' feature.
Find more on Setup and Configuration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!