You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio Flamingo启动应用失败:applicationId错误求助

解决Android Studio Flamingo启动应用时applicationId错误问题

升级至Android Studio Flamingo后,点击运行按钮无法启动应用,对比启动命令发现:

  • Dolphin版本使用正确启动命令:
    adb shell am start -n "com.freeman.bluedev/com.freeman.color.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
    
  • Flamingo版本错误使用了com.freeman.color作为applicationId:
    adb shell am start -n "com.freeman.color/com.freeman.color.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER --splashscreen-show-icon
    

修复方案

1. 确认并同步Gradle配置

检查模块级build.gradle(或build.gradle.kts)中的applicationId配置,确保其为正确值:

android {
    defaultConfig {
        applicationId "com.freeman.bluedev"
        // 其他配置项...
    }
}

配置无误后,点击AS右上角的Sync Project with Gradle Files按钮同步项目。

2. 手动修改运行配置

  1. 点击AS顶部工具栏的运行配置下拉菜单,选择Edit Configurations...
  2. 在左侧列表中选中你的应用运行配置,切换到General标签页
  3. 在Launch Options区域,将Launch设置为Specified Activity,手动输入完整组件名:com.freeman.bluedev/com.freeman.color.MainActivity
  4. 保存配置后重新运行应用

3. 清除Android Studio缓存

  1. 关闭Android Studio
  2. 删除对应缓存目录:
    • Windows:C:\Users\<你的用户名>\.AndroidStudioFlamingo\system\caches
    • macOS:~/Library/Caches/Google/AndroidStudioFlamingo
    • Linux:~/.cache/Google/AndroidStudioFlamingo
  3. 重启AS并同步项目

问题反馈渠道

若上述方案无效,可通过Google官方的Android Studio Issue Tracker提交问题:

  • 进入Issue Tracker后,选择Android Studio组件,按照模板填写问题详情,需附上:
    • 项目的Gradle配置片段
    • 两个版本的启动命令对比
    • 复现步骤

内容的提问来源于stack exchange,提问作者Sammy Freeman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 12:57:30