Hey, just pulled the KaMPKit project and I'm getti...
# touchlab-tools
m
Hey, just pulled the KaMPKit project and I'm getting the following error when trying to build the iOS app:
Command PhaseScriptExecution failed with a nonzero exit code
Android app is building successfully
Bit more detail running it from Android Studio:
Copy code
PhaseScriptExecution [CP-User]\ Build\ shared /Users/<redacted>/StudioProjects/KaMPKit/build/ios/Pods.build/Debug-iphonesimulator/shared.build/Script-46EB2E00000380.sh (in target 'shared' from project 'Pods')
k
there should be much more detail than that. That doesn’t really say much. Generally speaking, there will be some kind of compiling error. I would also try to build just the iOS target from the gradle command line to help diagnose the issue. Without any other info, it may be Xcode version, lack of tools installed, or something else along those lines.
m
Error from running
./gradlew build
:
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'KaMPKit'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve app.cash.sqldelight:gradle-plugin:2.0.0-rc01.
     Required by:
         project : > app.cash.sqldelight:app.cash.sqldelight.gradle.plugin:2.0.0-rc01
      > No matching variant of app.cash.sqldelight:gradle-plugin:2.0.0-rc01 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6' but:
          - Variant 'apiElements' capability app.cash.sqldelight:gradle-plugin:2.0.0-rc01 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'runtimeElements' capability app.cash.sqldelight:gradle-plugin:2.0.0-rc01 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
   > Could not resolve com.android.tools.build:gradle:7.4.2.
     Required by:
         project : > com.android.library:com.android.library.gradle.plugin:7.4.2
      > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
Tried switching to the version recommended here: https://github.com/touchlab/KaMPKit/blob/main/docs/DETAILED_DEV_SETUP.md but get the same result
k
Looks like you're using java 8 but sqldelight 2 needs java 11. I would guess everybody at touchlab is on java 11 so we never noticed that. I don't know that it's only sqldelight that requires it, btw. It might be other libraries too, but that's the one in the error message
m
Okay switched to Java 11 but
./gradlew build
still fails (error attached). Builds are launching successfully on Simulator/Emulator though. I did need to switch iOS version from 13.2 to 14 since
StateObject
has min version 14
k
That is weird. I'm seeing that too. Debug works, though. Will post an issue