android-studio - Gradle 同步失败 : com. android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException:模块: 'app' 平台 'android-29' 未找到

标签 android-studio ubuntu ubuntu-20.04 android-studio-4.1

在 Ubuntu 20.04 上安装了 Android 4.1。收到以下错误:Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'app' platform 'android-29' not found. 在打开 SDK 管理器时,我得到以下屏幕:
android studio screenshot
我也执行了$ANDROID_HOME/cmdline-tools/tools/bin/sdkmanager --licenses如何解决这个问题?
- - - 编辑 - - - - -
这就是 SDK 平台选项卡中显示的内容。取消选中“隐藏过时的包”不会改变任何东西。
Sdk platforms

最佳答案

正如错误所说。安装 API 级别 29 的 SDK 平台。您需要切换到“SDK 平台”选项卡并安装正确的 API 级别:
enter image description here
- - - - - -编辑 - - - - - - -
也许您不小心更改了 SDK 位置。
我的在 C:\Users\elmo\AppData\Local\Android\Sdk 注意:在 Windows 上使用它。

关于android-studio - Gradle 同步失败 : com. android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException:模块: 'app' 平台 'android-29' 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64677522/

相关文章:

ubuntu - 无法使用 Snapcraft 创建快照

java - 在 recyclerview 或 listview 中 float 部分栏,如电报

java - 在 iCODE 标签上写入后 NFC 停止工作,Android 6.0

c++ - 为什么 C++ 中的 shell 脚本代码不起作用?

ubuntu - 在 Ubuntu 12.04 : Location of virtualenvwrapper. sh 上设置 VirtualenvWrapper?

Python脚本递归打开目录中的.rar文件

java - 安卓/SQL服务器: Set Text to "No time" if the data at database is NULL

Android Studio 过渡及使用子库/共享库

git - 将 Flask 应用程序推送到 heroku : Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly 时出错

python - 在没有 sudo 的情况下使用 GPU 在 Ubuntu 20.04 上设置 Tensorflow 2.4