【问题标题】:I often found this specific error: "Could not identify launch activity: Default Activity not found Error while Launching activity"我经常发现这个特定的错误:“无法识别启动活动:启动活动时未找到默认活动错误”
【发布时间】:2019-01-08 09:51:43
【问题描述】:

这是我安装应用程序的 adb shell 命令,每次我安装应用程序时,它都会显示未找到默认活动。

$ adb shell pm install -t -r "/data/local/tmp/it.dabbl"
    Success
    APK installed in 9 s 725 ms
    Could not identify launch activity: Default Activity not found
    Error while Launching activity

【问题讨论】:

标签: android


【解决方案1】:

您必须在清单中定义您的启动器活动。

  <activity
    android:name=".MainActivity" //Whatever Activity you want to launch first>
      <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
  </activity>

【讨论】:

    【解决方案2】:

    所以在互联网上搜索了一个多小时后,我从项目结构中检查了我没有设置默认配置设置。要解决此问题,您必须打开项目结构,然后添加默认配置,然后与 gradle 同步即可解决此问题。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题,并通过手动设置启动活动解决了它。从菜单中选择“Run -> Edit Configurations...”,然后在“Launch Options”下选择“Launch: Specified Activity”和“Activity: your.launch.activity”,其中“your.launch.activity”是活动你想启动。

      【讨论】:

        猜你喜欢
        • 2017-01-28
        • 1970-01-01
        • 2016-02-24
        • 1970-01-01
        • 2016-11-17
        • 2020-09-22
        • 1970-01-01
        • 1970-01-01
        • 2012-07-23
        相关资源
        最近更新 更多