fix to ensure targetCompatibility is effective for Android

PR #4735 inadvertently turned Android's targetCompatibility into Java's targetCompatibility thereby rendering it ineffective for Android.
As a result Android used the toolchain version (17) instead of targetCompatibility 1.8 to create *.class files.
See also: https://developer.android.com/build/jdks
This commit is contained in:
Thomas Kuehne
2025-04-22 18:49:37 +02:00
parent f78d6b914e
commit d5c632f243
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -62,14 +62,14 @@ def getGitHashShort = { ->
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
android {
compileOptions {
coreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
namespace = 'nodomain.freeyourgadget.gadgetbridge'
@@ -72,7 +72,7 @@ public class UltrahumanDeviceCoordinator extends AbstractBLEDeviceCoordinator {
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
final Long deviceId = device.getId();
final Map<AbstractDao<?, ?>, Property> daoMap = new HashMap<>() {{
final Map<AbstractDao<?, ?>, Property> daoMap = new HashMap<AbstractDao<?,?>,Property>() {{
put(session.getGenericHeartRateSampleDao(), GenericHeartRateSampleDao.Properties.DeviceId);
put(session.getGenericHrvValueSampleDao(), GenericHrvValueSampleDao.Properties.DeviceId);
put(session.getGenericSpo2SampleDao(), GenericSpo2SampleDao.Properties.DeviceId);
@@ -199,7 +199,7 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
private final ZeppOsStepsService stepsService = new ZeppOsStepsService(this);
private final Set<Short> mSupportedServices = new HashSet<>();
private final Map<Short, AbstractZeppOsService> mServiceMap = new LinkedHashMap<>() {{
private final Map<Short, AbstractZeppOsService> mServiceMap = new LinkedHashMap<Short, AbstractZeppOsService>() {{
put(servicesService.getEndpoint(), servicesService);
put(authenticationService.getEndpoint(), authenticationService);
put(batteryService.getEndpoint(), batteryService);