Den Drobiazko
05/27/2025, 9:37 PMChrimaeon
05/27/2025, 9:45 PMDen Drobiazko
05/27/2025, 9:47 PMDen Drobiazko
05/27/2025, 9:53 PMisMinifyEnabled
set to true
in our library modules because we only expose the API relevant to our customers.
One of the components being published is this:
object LoggerProvider {
@JvmStatic
var logger: Logger = StubLogger()
}
It is intended to be used, for example, like this:
private val myLoggerFromThatSdk = LoggerProvider.logger
And it was before up until our update from AGP 8.3.2 to 8.8.2.
Also, if you perform a command + click on .logger
part, you will see this:
public object LoggerProvider {
@kotlin.jvm.JvmStatic public final var logger: io.scanbot.sdk.util.log.Logger /* compiled code */
}
Meaning that it was recognized as Kotlin class.
Also, at this point, if you click Decompile to Java
, the code would look like this:
@Metadata(
mv = {2, 1, 0},
k = 1,
xi = 48,
d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\bÆ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003R$\u0010\u0004\u001a\u00020\u00058\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0000\u0012\u0004\b\u0006\u0010\u0003\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\n¨\u0006\u000b"},
d2 = {"Lio/scanbot/sdk/util/log/LoggerProvider;", "", "<init>", "()V", "logger", "Lio/scanbot/sdk/util/log/Logger;", "getLogger$annotations", "getLogger", "()Lio/scanbot/sdk/util/log/Logger;", "setLogger", "(Lio/scanbot/sdk/util/log/Logger;)V", "Sources of scanbot-sdk-android.core-base.main"}
)
public final class LoggerProvider {
@NotNull
public static final LoggerProvider INSTANCE = new LoggerProvider();
@NotNull
private static Logger logger = (Logger)(new StubLogger());
private LoggerProvider() {
}
@NotNull
public static final Logger getLogger() {
return logger;
}
public static final void setLogger(@NotNull Logger var0) {
Intrinsics.checkNotNullParameter(var0, "<set-?>");
logger = var0;
}
/** @deprecated */
// $FF: synthetic method
@JvmStatic
public static void getLogger$annotations() {
}
}
However, after the update to this new AGP, the line LoggerProvider.logger
gives a compilation error at logger
part. If you click it, you see this decompiled class (not a Kotlin one - Java at once!):
public final class LoggerProvider {
@NotNull
public static final LoggerProvider INSTANCE = new LoggerProvider();
@NotNull
private static Logger logger = new StubLogger();
private LoggerProvider() {
}
@NotNull
public static final Logger getLogger() {
return logger;
}
public static final void setLogger(@NotNull Logger var0) {
Intrinsics.checkNotNullParameter(var0, "<set-?>");
logger = var0;
}
}
Note the metadata and this method being absent:
/** @deprecated */
// $FF: synthetic method
@JvmStatic
public static void getLogger$annotations() {
}
I suspect a newer, more strict R8 is being bundled with this newer AGP, but I wasn't able to find any mention of any relevant info or discussions online about this.
If anyone knows anything - I'd be very grateful.Den Drobiazko
05/27/2025, 9:58 PMSound like an issue with #C19FD9681 . Better move to this channel.As far as I understand, R8 is a part of the Android project. @Chrimaeon could you, maybe, share more insight on your idea of the core of this issue?
Chrimaeon
05/27/2025, 10:15 PMZsolt Boldizsár
05/28/2025, 9:14 AMminifyEnabled
starting with AGP 8.4.0? we had a similar issue back when we upgraded AGP from 8.2.2 to 8.7.3 https://developer.android.com/build/releases/past-releases/agp-8-4-0-release-notes#library-classes-shrunktrevjones
05/28/2025, 3:26 PM