error with configuring android studio with matlab
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
So i have been trying to configure matlab to work with android studio for a project and i came across Simulink Support Package for Android Devices ,but when i try to configure it i get this error message. Does anyone know how to fix this
Build App
A problem occurred configuring root project 'TestApp'. > Could not open cp_proj generic class cache for build file 'C:\Users\User\AppData\Local\Temp\tpee9cd55b_8ffa_4e98_82dc_4f945f5ab51c\TestApp\build.gradle' (C:\Users\User\.gradle\caches\7.5\scripts\56lbh5pj36js9453y7f1h6iim). > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 *
1 comentario
prabhat kumar sharma
el 27 de En. de 2025
You can refer this : https://www.mathworks.com/matlabcentral/answers/1623640-how-to-troubleshoot-sdk-issues-in-matlab#answer_871530
it might help you to reduce.
Respuestas (2)
Jaskirat
el 27 de En. de 2025
Hello,
I understand there is some error while trying to configure MATLAB to work with android studio.
The error message “Unsupported class file major version 65” suggests that the issue may lie with the compatibility of Gradle with the Java version. If possible, update Gradle to a version that supports the Java version you are using. You can do this by modifying the "gradle-wrapper.properties" file in your project:
distributionUrl=https\://services.gradle.org/distributions/gradle-version-bin.zip
Replace version with latest Gradle version.
Alternatively, switching to a compatible Java version may also resolve the issue.
Hope this helps!
0 comentarios
Arvid
el 15 de Abr. de 2025
I got this problem because I was using a too new version of Android Studio (2024 and JDK 21) vs. what MATLAB expects (2022 and JDK 17)
You can switch JDK by editing the file SupportPackages/R2024b/toolbox/target/supportpackages/android/template/AndroidBuild/gradle.properties. On my Linux machine SupportPackages is found in ~/Documents/MATLAB.
I commented out the java.home=${JavaHome} line and replaced it with a JDK downloaded using Android Studio:
# Copyright 2017-2023 The MathWorks, Inc.
org.gradle.daemon=true
android.enableJetifier=true
android.useAndroidX=true
#org.gradle.java.home=${JavaHome}
org.gradle.java.home=/home/<username>/.jdks/jbr-17.0.14
org.gradle.jvmargs=-Xmx1536M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g
org.gradle.configureondemand=false
org.gradle.caching=true
org.gradle.parallel=true
0 comentarios
Ver también
Categorías
Más información sobre Setup and Configuration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!