I tried installing the new moko-resources 0.24.0-b...
# moko
d
I tried installing the new moko-resources 0.24.0-beta-1 in a new (almost empty) project, and ran into a really strange
can't compile assets - 1
error on iOS. I'm not entirely sure it's a moko-resources bug, but perhaps there's a way to provide a better error diagnostic? I'll put the details in a 🧵.
The error was:
Copy code
> Task :shared:compileKotlinIosSimulatorArm64
can't compile assets - 1



FAILURE: Build failed with an exception.

> Task :shared:compileKotlinIosSimulatorArm64 FAILED
* What went wrong:
Execution failed for task ':shared:compileKotlinIosSimulatorArm64'.
> Assets compilation failed: 

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>./
... which I saw was coming from https://github.com/icerockdev/moko-resources/blob/590fc8f2eacbe5aca4992df83aa7473b[…]rock/gradle/generator/apple/action/PackResourcesToKLibAction.kt This error wasn't happening locally for me, it was only present on the build server (a Mac Mini that I have running my GitHub Actions). After remoting into the server, I tried the command with debugging info:
Copy code
./gradlew iosSimulatorArm64Test --debug --stacktrace
There was a lot of output, but this was the relevant part:
Copy code
2024-04-23T11:17:11.252-0400 [ERROR] [org.gradle.api.Task] can't compile assets - 1
2024-04-23T11:17:11.252-0400 [INFO] [org.gradle.api.Task] <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<dict>
        <key>com.apple.actool.compilation-results</key>
        <dict>
                <key>output-files</key>
                <array/>
        </dict>
        <key>com.apple.actool.errors</key>
        <array>
                <dict>
                        <key>description</key>
                        <string>The operation couldn't be completed. Failed to locate any simulator runtime matching options: {
    BuildVersionString = 21E210;
    Platforms =     (
        "com.apple.platform.iphonesimulator"
    );
    VersionString = "17.4";
}</string>
                        <key>failure-reason</key>
                        <string>Failed to locate any simulator runtime matching options: {
    BuildVersionString = 21E210;
    Platforms =     (
        "com.apple.platform.iphonesimulator"
    );
    VersionString = "17.4";
}</string>
                </dict>
        </array>
</dict>
</plist>

2024-04-23T11:17:11.252-0400 [ERROR] [org.gradle.api.Task]
That was able to point me in the right direction. Running
xcrun simctl list devices available
showed that I had no 17.4 sims on the build server. So, I tried to create one:
Copy code
xcrun simctl create "iPhone 15 (17.4)" "iPhone 15" iOS17.4
... but that failed with:
Invalid runtime: iOS17.4
Opening Xcode on the Mac mini and installing iOS 17.4 SDK, then creating a simulator, did the trick. (Previously, the highest SDK available I had installed on this particular Mac Mini build server was 17.2)
What's interesting is that
./gradlew iosSimulatorArm64Test
worked just fine before moko-resources was included in the project (the tests were run with one of the existing simulators). The task only started failing because the
xcrun actool Assets.xcassets --compile . --platform iphoneos --minimum-deployment-target 9.0
command was looking for the 17.4 simulator which wasn't installed... I'm not 100% sure why that is, or if there's something the moko-resources plugin can do to pick the same simulator as the multiplatform plugin to avoid erroring? Anyway, I thought this was worth sharing. I didn't file an issue for it because I'm not sure it's a bug... but it took a bit of digging to figure out so I wanted to share my findings here should anyone else encounter the same thing in the future. 👋
👍 1
a
can you create issue work this please? and write in this issue all info
👍 1
strange that actool require some simulator at all
d