简体   繁体   中英

Android platform not found when using intellij, kotlin multiplatform and gradle

I have an issues with intellij where platform 'android-31' is not found when I try to sync the gradle projects in our repo. But the realty annoying thing is all gradle tasks work through the command line and gradle sync works in android studio.

I have tried to reinstall the SDK and intellij, I have also tried using different SDK managers; command line (from homebrew), intellij and the one in android studio.

Environment:

Company Macbook Pro (M1 Pro, macos:12.5.1)
$ANDROID_HOME=/Users/{my_username}/Library/Android/sdk
# {repo_root}/local.properties
sdk.dir=/Users/{my_username}/Library/Android/sdk

Here is the error

Module: ':core' platform 'android-31' not found.

It turns out I needed to download Java 1.8, once that was done IntelliJ recognised the android SDK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM