Am trying out new AWS SDK for Kotlin (<https://aws...
# multiplatform
j
Am trying out new AWS SDK for Kotlin (https://aws.amazon.com/sdk-for-kotlin/) in shared KMP code and running in issue that following (in AWS SDK code) is returning true when running JVM code (located in
jvmMain
)...anybody know why that would be the case (the KMP module in this case targets just android and JVM) ?
Copy code
private static boolean isAndroid() {
        try {
            Class.forName("android.os.Build");
            return true;
        } catch (ClassNotFoundException ex) {
            return false;
        }
    }
d
Did you try to run the code with the debugger and print the classpath ?
j
Not yet, but can try that
ok, I guess not too surprising given following in
java
command logged (am running
main
directly from Android Studio here fwiw...will try command line and also not sure if IntelliJ behaves any differently here)
Copy code
-classpath /Users/joreilly/Library/Android/sdk/platforms/android-31/android.jar
d
You might check witch SDK is used to run you code in the execution configuration panel of intelliJ/Android Studio (if the option exist in android studio)
j
Yeah, if I run in IntelliJ instead I'm not seeing this issue
...and going back to AS I updated run config and it's running now ok there too!
d
🍾