[英]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.我有一个 intellij 问题,当我尝试在我们的存储库中同步 gradle 项目时,找不到platform 'android-31'
。 But the realty annoying thing is all gradle tasks work through the command line and gradle sync works in android studio.但真正令人讨厌的是所有 gradle 任务都通过命令行工作,而 gradle 同步在 android 工作室中工作。
I have tried to reinstall the SDK and intellij, I have also tried using different SDK managers;我尝试重新安装 SDK 和 intellij,我也尝试使用不同的 SDK 管理器; command line (from homebrew), intellij and the one in android studio.命令行(来自自制软件)、intellij 和 android 工作室中的命令行。
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.事实证明,我需要下载 Java 1.8,一旦完成,IntelliJ 识别出 android SDK。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.