Android Build Error, deprecated API

What platform are you building for?

Android

What framework are you building with?

Cordova

What is your build ID?

78f79a88-2db8-4759-b685-b16fb7ce8a2c

What is your error message?

This app was last successfully built on 9/6/2023. I resubmitted it today, 3/21/2026, and received the following error:

Task :CordovaLib:compileReleaseJavaWithJavac
/AIAVoltBuild/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java:256: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
^
symbol: variable BAKLAVA
location: class VERSION_CODES
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

Task :CordovaLib:compileReleaseJavaWithJavac FAILED

[Incubating] Problems report is available at: file:///AIAVoltBuild/platforms/android/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

You should be able to solve this problem by targeting SDK 36, rather than 35 as you are now. Let me know if this works.

Thank you - SDK 36 worked! Could you help me understand why 36 worked and 35 failed. Also what should I be looking at in the future to avoid surprises like this. Thanks, Bob.

1 Like

In this case SDK 36 worked because you are using the latest cordova-android engine, which expects SDK 36. If you were to switch to an older engine (like 14.0.1) then SDK 35 would have worked without issue.