after upgrading from Kotlin 1.6.10 to 1.6.20, I'm ...
# gradle
t
after upgrading from Kotlin 1.6.10 to 1.6.20, I'm suddenly hitting this error in my KMM project. Any idea why? Upgrading to 1.6.21 or 1.7.0 doesn't help:
Copy code
Task 'runCommonizer' not found in project ':android'
p
What’s the context here? Where do you see that message?
t
cc @Sebastian Sellmair [JB]
🙏 1
t
it happens when I Gradle sync in Android Studio. The only output in the
Build
pane is:
Copy code
Task 'runCommonizer' not found in project ':android'.

* Try:
> Run gradle tasks to get a list of available tasks.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.execution.TaskSelectionException: Task 'runCommonizer' not found in project ':android'.
	at org.gradle.execution.DefaultTaskSelector.getSelection(DefaultTaskSelector.java:113)
	at org.gradle.execution.DefaultTaskSelector.getSelection(DefaultTaskSelector.java:78)
	at org.gradle.execution.CompositeAwareTaskSelector.getSelection(CompositeAwareTaskSelector.java:94)
...
I can run anything through
gradlew
if it would give you needed detail (I've just personally never found
--debug
, etc. helps me debug issues)
my iOS app builds through the KMM
embedAndSignAppleFrameworkForXcode
Gradle task and doesn't have a problem
p
Did you try with intellij?
t
just tried with the latest version of IntelliJ CE and it seems its Android support isn't compatible with my project (which I've been developing with Android Studio 2021.1.1 patch 3)
I guess I can upgrade AS and try again. I've been putting it off until I get my next release out but it should be fairly safe
maybe I shouldn't have said that because now the KMM plugin blows up on Android Studio start with the new version 😕
p
Yeah for ij you need to downgrade agp
t
after uninstalling and re-installing the KMM plugin the plugin issue and my original
runCommonizer
issue are both fixed 🙂
not sure what the original issue was. Maybe upgrading the IDE was necessary
p
Yeah that is often time a fix: go from stable to canary to stable. Fixes most of the ide bugs 🙃
s
Does somebody have a sample project for this one? Or knows which IDE reproduced this?
I think a simple workaround for older IDEs would be
Copy code
tasks.register("runCommonizer") {
    dependsOn(tasks.getByName("commonize"))
}
But this should work for you! Very strange to see: The
runCommonizer
task name (old) was never removed and is kept in KGP for compatibility ./
t
I wasn't able to narrow down exactly what my issue was
I always try to avoid upgrading to a less-stable track, even temporarily, where I can 🙂
then again, I've rebased my entire project on KMM which is self-declared as "alpha". Definitely the most solid "alpha" I've ever seen though!
s
I always try to avoid upgrading to a less-stable track, even temporarily, where I can
This sounds very reasonable to me blob smile happy Lets just be glad that the issue seems to be not affecting you anymore and I will be warned if I ever see somebody hitting this again!