I’m encountering an issue while trying to run cordova emulate android in my project. The error message I’m seeing is:
Error: Could not find or load main class com.android.tools.apk.analyzer.ApkAnalyzerCli
Caused by: java.lang.ClassNotFoundException: com.android.tools.apk.analyzer.ApkAnalyzerCli
This error occurs during the build process and seems related to apkanalyzer. I’ve checked my Android SDK installation and environment variables (ANDROID_HOME and ANDROID_SDK_ROOT), which are correctly set. Additionally, I’ve updated my build tools (build-tools;32.0.0) and ensured my Java JDK version (JDK 11) is compatible.
I’ve tried:
Verifying SDK tools installation.
Updating environment variables.
Adding android.suppressUnsupportedCompileSdk=33 to gradle.properties.
Ensuring JDK compatibility.
Despite these steps, the issue persists. How can I resolve this ClassNotFoundException with com.android.tools.apk.analyzer.ApkAnalyzerCli?
Any guidance or insights would be greatly appreciated. Thank you!
ayub is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.