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

3 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
Effesian
Effesian on 30 Jun 2022
Hello Sutanu Maiti,
Thanks for your reply. I do have
  • Android SDK build tools
  • NDK
  • Android SDK platform tools
  • Google USB drivers (since I am using a Google Pixel phone)
installed and selected on the Android Hardware Setup Screen 'Latest Version'.
I believe the setup fails because I cannot be on the same network (AND connected to the internet) with both my Android phone and development computer due to my companies IT policy. Is there any other way to run the Hardware setup without both the phone and the development PC running MATLAB being connected to the same network?
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.

Products

Community Treasure Hunt

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

Start Hunting!