活动类不存在 [英] Activity class does not exist

查看:119
本文介绍了活动类不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Aaaargh!我不知道这是怎么回事,但我突然无法启动我的应用程序。我使用的IntelliJ和我不断收到此错误。我想也许有一个错字某处的清单,但似​​乎并不如此。继承人'错误:

Aaaargh! I don't know what's going on, but suddenly I can't launch my app. I'm using IntelliJ and I keep getting this error. I thought maybe there was a typo somewhere in the manifest, but there doesn't seem to be. Heres' the error:

Launching application: com.foo.app/com.foo.app.main.
DEVICE SHELL COMMAND: am start -n "com.foo.app/com.foo.app.main"
Starting: Intent { cmp=com.foo.app/.main}
Error type 3
Error: Activity class {com.foo.app/com.foo.app.main} does not exist.

和这里是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.foo.app">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".main">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name=".NoBellsActivity"/>
    </application>
</manifest>

而奇怪的是,亚行让我发现了ActivityManager开始的意图就好了......

And the strange thing is that ADB shows me that the ActivityManager is starting the intent just fine...

推荐答案

现在的问题是在你的项目的构建/运行配置。 你必须检查在运行/调试配置屏幕上的部署应用程序复选框,在常规选项卡。

The problem is in the build / run configuration of your project. You have to check the "Deploy application" checkbox in the Run/Debug Configuration screen, under the General tab.

这解决了我的问题。

这篇关于活动类不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆