Simulink Support Package For Android Devices --> Hardware Configuration: Building TestApp fails

6 views (last 30 days)
Hello,
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:
Build App
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: 9.11.0.1873467 (R2021b) Update 3
When running in the MATLAB command line:
>> codertarget.android.internal.AndroidStudioWorkflowValidator.getInstance
I get:
ans =
AndroidStudioWorkflowValidator with properties:
AndroidStudioPath: 'C:\Program Files\Android\Android Studio'
AndroidSDKPath: 'C:\Users\MYNAME\AppData\Local\Android\sdk'
GradlePath: []
JavaJDKPath: 'C:\Program Files\Android\Android Studio\jre'
NDKPath: 'C:\Users\MYNAME\AppData\Local\Android\sdk\ndk\24.0.8215888'
ARMComputeLibPath: []
GradleVersion: '6.7.1'
GradlePluginVersion: '4.2.0'
CompileSdkVersion: '33'
BuildToolsVersion: '33.0.0'
SupportV4Version: []
AppcompatV7Version: []
DesignVersion: []
IsCappedVersion: 0
gradleWrapperPath: 'GradleWrapper\wrapper'
Any idea what is going wrong? Thanks!

Answers (1)

Sutanu Maiti
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.
  2 Comments
Sutanu Maiti
Sutanu Maiti on 1 Jul 2022
Hello @Effesian,
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:
>> cd(prefdir)
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!