How to build a CapacitorJS app for Anddroid 6 (SDK 23)?

I have a project that uses CapacitorJS v6 and I need to build it for android 6 (SDK level 23).

I changed the compileSdkVersion and targetSdkVersion to 23 in the variables.graddle file, but I got this error: "In order to compile Java 9+ source, please set compileSdkVersion to 30 or above"

Since I need to compile this project using SDK 23 of android, I changed JDK version to 1.8 (Java 8). I changed it for all modules. Now I'm getting errors from Java code, like "'switch' expressions are not supported at language level '8'".

Does someone have any idea about how can I build this project for android 6?

Upvotes: 0

Views: 36

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53341

Capacitor supports SDK 23 out of the box, you don’t have to change the targetSDK for that, what determines the minimum supported version is the minSDK, which for Capacitor 6 is 22.

In fact the targetSDK should be set to 34 as it’s a requirement for submitting the apps to Google play.

Upvotes: 1

Related Questions