Hi, I'm an absolute beginner going through the Com...
# getting-started
j
Hi, I'm an absolute beginner going through the Compose Multiplatform demo app. I got it to build and run for all of the targets except for Android, where I get the attached error message "please select Android SDK". Under File->Project Structure->SDKs I have Android API 36.0, extension level 17 installed. Is there somewhere else I'm supposed to set the Android SDK? Thanks!
j
Yeah you need to set ANDROID_HOME environment variable Or install the Android plugin in your IDE Or set
sdk.dir
to your Android SDK location in your
local.properties
I'm not really sure why we can select Android SDKs in project structure, but it doesn't really change anything
j
Thanks @Jack Boswell. I have all three of those things set.
echo $ANDROID_HOME
returns
/Users/jack/Library/Android/sdk
, this same value is in
local.properties
, and the Android plugin is installed (I think the Kotlin Multiplatform plugin installed it as a dependency). Any other ideas?
j
Weird, are you able to build OK? I'll check a new project on my machine
j
It builds fine, and runs all the other configurations fine (jvm, js, wasmjs, iOS). The Android one doesn't run for some reason – it pops up the error dialog I posted above.
j
Well yes, but are you able to build the Android configuration from the command line, or just executing the Gradle task manually?
j
Copy code
jack ComposeDemo % ./gradlew :composeApp:assembleDebug
Reusing configuration cache.

BUILD SUCCESSFUL in 1s
42 actionable tasks: 4 executed, 38 up-to-date
Configuration cache entry reused.
looks okay I think?
j
Yep, now we know it's just an IDE problem and not an environment one 🤔
j
I tried the obvious thing of quitting/restarting. Is there a way to flush temp files/cache?
j
File -> Invalidate caches/restart
j
That worked!! Big thanks
🙌 1
j
Nice! I think that's the first time I've seen IDE caches break that in particular 😄
j
I may have done something in a nonstandard order, not sure. 🤷‍♂️ Anyway thanks again, CMP full speed ahead!
K 1