我正在Eclipse中的Android项目上工作,并使用我的HTC Desire z进行调试/测试。当我开始获得此错误时,我正在为我的应用程序编写菜单,这阻止了我继续。很多人都犯过这个错误,但我找到的解决方案都不适合我。我尝试清理和重建项目,手动从我的手机上卸载应用程序,并在清单文件中重命名域名。对于使用模拟器的人来说,他们谈论的是删除数据文件,但我不确定这在使用真正的手机时是什么意思。
这是我尝试构建时的控制台:
[2011-08-09 06:57:13 - GreenThumbs] Android Launch!
[2011-08-09 06:57:13 - GreenThumbs] adb is running normally.
[2011-08-09 06:57:13 - GreenThumbs] Performing com.hernblog.GreenThumbs.GreenThumbs activity launch
[2011-08-09 06:57:13 - GreenThumbs] Automatic Target Mode: using device 'HT0ANRV03417'
[2011-08-09 06:57:13 - GreenThumbs] Uploading GreenThumbs.apk onto device 'HT0ANRV03417'
[2011-08-09 06:57:13 - GreenThumbs] Installing GreenThumbs.apk...
[2011-08-09 06:57:16 - GreenThumbs] Success!
[2011-08-09 06:57:17 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:19 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:22 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:23 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:23 - GreenThumbs] ActivityManager: Error: Activity class {com.hernblog.GreenThumbs/com.hernblog.GreenThumbs.GreenThumbs} does not exist.
[2011-08-09 06:57:26 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:27 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:30 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:30 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:33 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:34 - GreenThumbs] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.hernblog.GreenThumbs/.GreenThumbs }
[2011-08-09 06:57:34 - GreenThumbs] ActivityManager: Error type 3
[2011-08-09 06:57:34 - GreenThumbs] ActivityManager: Error: Activity class {com.hernblog.GreenThumbs/com.hernblog.GreenThumbs.GreenThumbs} does not exist.
这是我的清单文件:
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hernblog.GreenThumbs"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application>
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.hernblog.Green.Thumbs" android:label="GreenThumbs Tests" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="GreenThumbs"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
有什么办法解决这个问题吗?
我在更改应用程序的包名后也立即遇到了这个问题(为Android Market做准备)。在Eclipse中执行Project> Clean…,然后关闭"自动构建",这样就可以"全部构建"。
我重命名我的项目包后得到这个错误。我通过在Eclipse中进行清理来修复它。然后是完整的重建。之后按F11启动设备上的应用程序。(在此之前,我也从设备上卸载了应用程序,但我不认为这是问题所在)。
我通过取消勾选Project->Properties->Android
真是一个令人困惑的错误…对我有效的是:将Manifest xml文件中的应用包名称重命名为其他名称,any!保存项目,试着运行它,我的给出了很多错误,没有运行!再次回到老名字…保存并运行!
清理项目对我不起作用。我能够通过执行以下操作来解决此问题:
添加# !/system/bin/sh作为第一行/system/bin/am
添加一个# !/system/bin/sh作为第一行/system/bin/pm
我在手机上使用一些自定义rom时遇到了这个问题。
希望这能解决你的问题,
Joey
这是eclipse的问题解决方法之一是在清单中重命名包例如重命名
package="com.hernblog.GreenThumbs"
package="com.hernblog.GreenThumbs1"
编译并构建这个,然后把它放回你想要的名字
package="com.hernblog.GreenThumbs"
的作品作为一个魅力:)
我也得到了同样的错误。并能按以下步骤解决
在你正在测试的手机中,
1。进入设置>应用程序>已下载
2。到底部,我发现我的应用程序被禁用了。
3。现在卸载它。
4。在下次运行时可以正确安装。
谢谢。
检查包名。在某一点上,你使用com.hernblog.GreenThumbs
(不寻常的有大写的包名),然后com.hernblog.Green.Thumbs
,你甚至有一个名为com.hernblog.GreenThumbs.GreenThumbs
的活动!
我设法通过一些巫毒魔法的步骤组合来解决这个问题。我做了上面提到的许多事情,但我认为当我升级到新版本的Android时,大的修复发生了。
谢谢大家的帮助。对于如何解决这个问题,我没有一个明确的答案,对此我深表歉意。
好的,这是我的答案。我绞尽脑汁想找出这个问题的答案。我在他的链接中发现,这个人基本上必须创建一个新项目,并将所有旧文件复制到其中。所以,我就是这么做的,而且成功了!我简直不敢相信。我花了很长时间才找到它。
然而,当我在做我的新项目时,我做了一个改变,同样的错误再次发生。幸运的是,我知道我做了什么更改,我撤消了它,错误清除了。
我在android清单中添加了另一个应用程序标签,然后它产生了错误。我只是撤销了它,错误就消失了。
我在Google Play中打开我的应用程序,并按"启用"…哇!我在舱单上发现:android:enabled="false"
…)
我必须重置我的设备/手机
关于我如何混淆我的设备的背景:
- 我把app .apk推到/system/app(我猜这是错误的地方) 我还使用eclipse直接通过adb进行部署。然后我手动卸载这些应用程序通过设置
- 然后我遇到了引用的错误"新包尚未注册到系统"。
我的答案是:在你朋友的设备上测试一下。
我也有同样的问题。我的手机是LG lu-3000。我将项目从Mac移到Windows后出现了此症状。在卡住了10天后,我发现它可以在Android虚拟设备上运行(但太慢了,无法测试任何东西),现在花了几天时间,发现它可以在其他设备上运行!!
在我测试AVB和摩托罗拉仿生之前,我重置了我的手机,并做了上面的一切。但这并没有改变任何结果。它不能在Mac和Windows上运行。
更糟糕的是,现在我的android项目没有一个在我的设备上运行。从我购买这个设备到现在已经快2年了。如果您已经从连接的设备上手动删除了应用程序,并且您仍然得到相同的错误,请重新启动连接的设备,它将正常工作!
在AndroidManifest.xml中检查"android:installLocation"
"preferExternal"
会导致这个问题。
在更改应用程序的包名后,我也立即遇到了这个问题。在Eclipse中转到Project-> Clean,然后关闭Build-Automatically,以便您可以Build-All,不要忘记重新启动Eclipse 。这对我来说很好…
我通过将项目的最低SDK级别设置为低于手机的SDK级别来解决这个问题。
也尝试从设备中释放内存,卸载一些应用程序来做到这一点。为我解决了这个问题。
一定要有
<uses-sdk
android:minSdkVersion="yourMinSDKver"
android:targetSdkVersion="youtTargetSDKver" />
在顶部,在您的manifest.xml
文件中。我不小心交换了,得到了同样的错误。
我犯了一个非常愚蠢的错误。当我抓住它时,我笑了。一个应用程序中有两个应用程序标签!!看一看
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.riddhi.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".WCFActivity"
android:label="@string/title_activity_main" >
</activity>
</application>
应该是
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.riddhi.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".WCFActivity"
android:label="@string/title_activity_main" >
</activity>
</application>
所以我修复了我的项目。我希望这对你有用。
检查您的Manifest文件。如果它有多个标签,它将面对这个问题,因为它将在它找到的第一个应用程序标签中查找Class。