无法在模拟器/设备上运行 Android 应用程序 - 活动不存在?
当尝试在模拟器上运行我的应用程序时,我从活动管理器中收到错误:
ActivityManager: Error type 3
我的活动存在,已在清单中列出(实际上,它是主启动器活动)。
有人知道这个错误是什么意思吗?
When trying to run my application on the emulator I get an error from the activitymanager:
ActivityManager: Error type 3
My activity exists, is listed in the manifest (in fact, its the MAIN launcher activity).
Anyone know what this error means?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
如果您正在运行 Eclipse,请尝试Projects-->Clean..。并在再次运行之前清理项目。
If you are running Eclipse try Projects-->Clean... and clean the project before running again.
我遇到了同样的问题。我清理了项目并删除了 android 清单中的 android:enabled=false 。这解决了这个问题。
i faced the same issue. I cleaned the project and removed the android:enabled=false in android manifest. This solved the issue.
检查 AndroidManifest.xml 中的“android:installLocation”。
“preferExternal”会导致问题。
Check "android:installLocation" in your AndroidManifest.xml.
"preferExternal" will cause the problem.
我收到此错误是因为我在项目名称中使用了无效字符,并且 Android 没有警告我这一点,所以我不知道问题所在...
示例:“这不正确!”
I got this error because I used invalid characters in my project name and Android didn't warned me about it so I had no idea that was the problem...
Example: "Thís ís íncorrect!"
不用担心,当活动管理器无法找到您的应用程序的活动时,有时会发生这种情况,这意味着您的目标模拟器尚未启动,或者可能是由于以下原因:
当您尝试在模拟器上运行您的应用程序时,您可能会被取消在构建或强制关闭模拟器之间。在这种情况下,当尝试再次启动模拟器时,它有时不会最大化。
现在您必须重新启动 Eclipse,然后启动模拟器并运行您的应用程序,现在您将不会遇到此类错误
nothing to worry about that it happens sometimes when activity manager unable to find activity of your app that means your target that is emulator is not started yet or may be because of following reason:
when you try to run your app on emulator you may be cancled in between building or forcefully closed your emulator.In that case when try to start emulator again it will sometimes not maximized.
now you have to restart your eclipse and then launch emulator and run your app now you will not face this type of error
不记得我是如何解决这个问题的 - 很可能我擦除了本地副本并重新从 svn 中签出。
Dont remember how I fixed this - most probably I wiped the local copy and re-checked out of svn.
ActivityManager:错误类型 3
我不知道这有多真实,但我使用了另一个应用程序中的相同共享首选项文件......并收到了此错误。我为共享首选项选择了一个新名称,问题就消失了。现在正在运行
ActivityManager: Error type 3
I don't know how true it is, but I used the same shared preferences file from another app..and got this error. I chose a new name for the shared preferences and the problem has gone away. It's working now
我的手机上没有足够的空间,这就是我遇到这个问题的原因。
所以我清理了它并开始运行)
I had not enough space on my phone, that's why I had this problem.
So I cleaned it and go RUN )
当我尝试向我的应用程序添加硬件加速时,错误地在清单中添加了第二个
application
标签时,出现此错误:我将其添加到我的实际应用程序标签上方,我认为这会导致 Android 部署我的手机上有一个空的“应用程序”。它在日志中报告“安装成功”,但没有启动器图标。不过,它确实出现在“设置”->“设置”下。应用程序,但我唯一能做的就是卸载它。希望这对某人有帮助。
I got this error when I mistakenly added a second
application
tag in my manifest as I was trying to add hardware acceleration to my app:I added it above my actual application tag and I think this resulted in Android deploying an empty 'app' to my phone. It reported 'Installation success' in the logs and yet there was no launcher icon. It did appear, though, under Settings -> Apps but the only thing I could do there was to uninstall it. Hope this helps someone.
因此,出现此错误的原因似乎有很多。
对于那些无法使用上述方法修复它的人:
在我的例子中,我重命名了我的活动的名称(在 Eclipse 中使用 F2)并且它被修复了。
Thus, it seems there can be many reasons to see this error.
For those who can't fix it using the above mentioned methods:
In my case, i renamed the name of my activity (using F2 in Eclipse) and it is fixed.