Hi all, Anyone encountered this before? I'm using ...
# multiplatform
x
Hi all, Anyone encountered this before? I'm using
kotlin-dsl
and the IDE seems to contradict itself when it (and the build) says that it cant this reference even when the source has it.
Copy code
Unresolved reference: iosSimulatorArm64
I'm using AS Chipmunk with Kotlin 1.7.10, Gradle 7.4.2, AGP 7.2.1 on a M1 mac
1
buildSrc/build.gradle.kts
Copy code
repositories {
  mavenCentral()
  maven("<https://kotlin.bintray.com/kotlinx>")
  maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
}

plugins {
  `kotlin-dsl`
}
build.gradle.kts
Copy code
buildscript {
  repositories { .. }

  dependencies {
    classpath(Android.buildTools) // "com.android.tools.build:gradle:7.2.1
    ..
    classpath(Jetbrains.Kotlin.gradlePlugin) // org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10
    ..
  }
}
welp, went down this rabbit hole all day today and I don't think i'm any closer to solving this issue. 😞 from the looks of it, when we use
kotlin-dsl
with
buildSrc
it has a
embeddedKotlinVersion
set to 1.5.10 but cant figure out why a
./gradlew assemble
cant see
iosSimulatorArm64
even from the terminal think im gonna walk away from this for now, this build tooling is too big of a 🐉 for me
j
This smells like configuration setup error, without seeing the entire project setup it is somewhat hard to help you
e
What version of gradle are you using? The latest should use 1.6.21 for
kotlin-dsl
x
Was using Gradle 7.4.2, which had
embeddedKotlinVersion
set to 1.5.10. Then I switched to Gradle 7.5 and now i see
embeddedKotlinVersion
set to 1.6.21, but i'm still seeing
Copy code
Unresolved reference: iosSimulatorArm64
e
Looks like someone had this issue, but they resolved it by updating Kotlin - https://youtrack.jetbrains.com/issue/KT-49681/Unresolved-Reference-iosSimulatorArm64
x
Could it be that one or more libraries/plugins I'm using not targeting that
iosSimulator64
?
e
I think that was a separate issue. It shouldn't cause it to not get resolved. It's more likely that the correct version of Kotlin still isn't being used
s
Issue resolved? If not, ping me, we can look at this together.
x
not really - let me see if i can extract a minimal project that can still reproduce the issue and post it here - thanks for the help @Sebastian Sellmair [JB]
I fixed it 🙌 The process of extracting a minimal project made me painstakingly extract bit by bit and made me realise the culprit was one of the gradle plugins i was using (
dev.petuska.npm.publish
) was outdated. After updating that, it finally recognised
iosSimulatorArm64
Spent solid two days on trying to fix this build tooling, and here are some lessons learned • Don't trust the IDE - always see if you can
./gradlew assemble
from terminal instead of syncing on AS. The IDE will eventually catch up but relying on it to tell you - what is wrong - is a loosing battle • If you have a multi-platform-multi-module setup, first try to isolate the issue to a single module by unloading other modules. In my project, i had a
:core
module, which is consumed by a number of
:feature
modules and an
:app
module on the very top that consumed the features. I started with diagnosing with just
:core
and worked my way back. Wasted so much time synching forever just to realise that i forgot to update a feature module • Always ask out for help 😅 this community has been super helpful and I would've just given up if it weren't for people volunteering to help me out. Thank you @Sebastian Sellmair [JB] @eygraber @Joakim Forslund