Tests failing for `Writing tests for Platform` section

The tests from chapter 8, section Writing tests for Platform, are failing for me. When I run all the tests using the command ./gradlew :shared:allTests, it gives me this error:

> Task :shared:iosSimulatorArm64Test
Invalid device: iPhone 12
java.lang.IllegalStateException: command '/usr/bin/xcrun' exited with errors (exit code: 148)

If i try to run just the AndroidTest it gives me this error:

SUPPORTED_ABIS must not be null
java.lang.NullPointerException: SUPPORTED_ABIS must not be null
	at com.raywenderlich.organize.Platform.<init>(Platform.kt:47)

For some reason, the actual PlatformTest class in androidTest also shows this error: Actual class 'PlatformTest' has no corresponding expected declaration

Xcode 14 seems to have removed multiple simulators from the system.
You can create a new simulator using the command below:

xcrun simctl create "iPhone 12" "iPhone 14"

Post running the command, ./gradlew :shared:allTests should run fine.

As for androidTest not running, it seems to be a conflict between KMM and the Android Gradle plugin. androidTest is a name reserved by the Android Gradle Plugin and but the format {module}Test is needed by KMM. There doesn’t seem to be a solution at the moment
You can follow the discussion at Google Issue Tracker

Hi @talhamir

Just wanted to do a follow up. We hope that the response provided by @subhrajyotisen was helpful in addressing your concerns.

If you have any further questions or need additional assistance, please don’t hesitate to ask. Our community is here to support you!