【问题标题】:session app error launching an activity - how to fix that?会话应用程序错误启动活动 - 如何解决?
【发布时间】:2018-12-07 09:04:52
【问题描述】:

在真实设备和模拟器上安装应用时出现以下错误。

session-app-error-launching-activity-in-android-studio

我尝试了下面的链接,但没有任何结果

即使新建项目后也会出现这个错误。

  1. Session 'app': Error Launching activity
  2. Session app: Error launching Activity in Android Studio 3.Android Studio: Session 'app': Error Launching activity 4.Error while Launching activity 5.Session 'app': Error Launching activity in Android Studio 3.1.3

这是我的清单文件代码

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.efunhub.neworganicveg">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

  </manifest>

编辑配置窗口的屏幕截图

提前致谢。

【问题讨论】:

  • 你能显示错误日志吗?
  • 没有任何异常,当我尝试在设备上安装应用程序时,应用程序无法安装
  • 在启动选项中将默认活动更改为主活动
  • 好的,会告诉你的,谢谢。
  • @GaneshGudghe 我已经尝试过你的方案,但仍然遇到同样的错误

标签: android


【解决方案1】:

转到文件 -> 无效缓存/重新开始尝试这样做,希望它有效。

【讨论】:

    【解决方案2】:

    一个更好的解决方案,而不是禁用instant run。删除.idea文件夹和.gradle文件夹,然后点击按钮sync project with gradle files,此过程完成后,您就可以正常运行您的应用了。

    祝你好运~

    【讨论】:

    • 有帮助吗..?
    猜你喜欢
    • 2016-07-31
    • 1970-01-01
    • 1970-01-01
    • 2016-08-31
    • 1970-01-01
    • 1970-01-01
    • 2021-08-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多