Unable to Build Android test app on Device (Android device support package) - MATLAB R2021a

5 views (last 30 days)
Hello dear friends,
I am having issues when trying to build the test app in hardware setup of Simulink support package for Android devices.
The error for the "Build App" task is as follows:
A problem occurred configuring root project 'TestApp'. > Could not resolve all artifacts for configuration ':classpath'. > Could not find gradle.jar (com.android.tools.build:gradle:3.5.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar > Could not find builder.jar (com.android.tools.build:builder:3.5.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.5.0/builder-3.5.0.jar > Could not find builder-test-api.jar (com.android.tools.build:builder-test-api:3.5.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/builder-test-api/3.5.0/builder-test-api-3.5.0.jar > Could not find bundletool.jar (com.android.tools.build:bundletool:0.9.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.9.0/bundletool-0.9.0.jar > Could not find protos.jar (com.android.tools.analytics-library:protos:26.5.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/protos/26.5.0/protos-26.5.0.jar *
Can anyone help me with it please? I feel free to mention that running the command below results in the mentioned specs:
codertarget.android.internal.AndroidStudioWorkflowValidator.getInstance
ans =
AndroidStudioWorkflowValidator with properties:
AndroidStudioPath: 'C:\Program Files\Android\Android Studio'
AndroidSDKPath: 'C:\Users\STRIX\AppData\Local\Android\sdk'
GradlePath: []
JavaJDKPath: 'C:\Program Files\Android\Android Studio\jre'
NDKPath: 'C:\Users\STRIX\AppData\Local\Android\sdk\ndk\23.0.7196353'
ARMComputeLibPath: [1×5 struct]
GradleVersion: '5.4.1'
GradlePluginVersion: '3.5.0'
CompileSdkVersion: '30'
BuildToolsVersion: '31.0.0 rc2'
SupportV4Version: []
AppcompatV7Version: []
DesignVersion: []
gradleWrapperPath: 'GradleWrapper\wrapper'
  1 Comment
Sutanu Maiti
Sutanu Maiti on 8 Apr 2021
Hi Mehdi,
Can you please uninstall ndk version 23.* and install 22.*. Also build tools version 30 (not any rc1 / rc2 releases) and try again?
Also please make sure internet connection is up and running while building TestApp, besause gradle downloads certain tools from online during its first build.
Thanks,
Sutanu

Sign in to comment.

Answers (1)

Sutanu Maiti
Sutanu Maiti on 8 Apr 2021
https://www.mathworks.com/matlabcentral/answers/788579-unable-to-build-app-in-verify-configuration-of-your-android-device#comment_1432124
  3 Comments
Sutanu Maiti
Sutanu Maiti on 9 Apr 2021
Looks like something is stopping gradle to download those jars (it could be the firewall or the antivirus program on that pc) from online repositories.
Can you check if creating new project in Android Studio and build goes through or faces same issue? Try to match (GradlePluginVersion: '3.5.0' and CompileSdkVersion: '30') in your newly created project's build.gradle file.
Mehdi Ejtehadi
Mehdi Ejtehadi on 9 Apr 2021
Edited: Mehdi Ejtehadi on 9 Apr 2021
Android Studio itself works just fine... Although the firewall issue might be the right suggestion. I will try things out.
For now I'm going to use MATLAB Coder to get a C source code and use it by NDK in Android Studio...
Thanks for your time

Sign in to comment.

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!