简体   繁体   English

使用 intellij、kotlin 多平台和 gradle 时找不到 Android 平台

[英]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.

相关问题 多平台或 android 平台单独和桌面单独用于 Kotlin - multiplatform or android platform alone and desktop alone for Kotlin 在 Kotlin 多平台库中使用 Android 库 - Using Android library in Kotlin multiplatform library Kotlin 多平台:找不到插件 [id: 'com.android.library'] - Kotlin Multiplatform : Plugin [id: 'com.android.library'] was not found Android Studio:如何在 Kotlin 多平台共享模块 build.gradle.kts 中访问项目级 compileSdkVersion 和 targetSdkVersion? - Android Studio: How to access project level compileSdkVersion and targetSdkVersion in Kotlin Multiplatform shared module build.gradle.kts? 在 Kotlin Multiplatform 中使用 Java 库 - Using Java library with Kotlin Multiplatform 使用 Kotlin Multiplatform Mobile (KMM) 的多平台应用程序中的数据绑定错误 - DataBinding error in multiplatform app using Kotlin Multiplatform Mobile (KMM) Kotlin Multiplatform - iOS + Android 之间的策略共享 - Kotlin Multiplatform - Strategy sharing between iOS + Android Kotlin Multiplatform ~ 在 Android 和桌面上添加图像 - Kotlin Multiplatform ~ Add images on Android and Desktop Kotlin Multiplatform Android导入无法解决 - Kotlin Multiplatform Android Imports won't resolve Kotlin 使用 gradle Intellij 构建未使用新控制台应用程序项目构建 - Kotlin build not building with fresh console application project using gradle Intellij
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM