开发者

New package not yet registered with the system. Error on a real phone

I am working on an Android project in Eclipse and debugging / testing using my HTC Desire Z. I was coding away building a menu for my app when I started getting this error which is preventing me from continuing. Lots of people have had this error but none of the solutions that I found have worked for me. I tried cleaning and rebuilding the project, manually uninstalling the app from my phone, and renaming the domain in the manifest file. For people using an emulator they talked about deleting the data file but I'm not sure what this translates to when using a real phone.

Here is the console when I try to build:

[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.

And here is my manifest file:

?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>

Any ideas on how to fix this?


I too had this problem immediately after changing the package name of my app (prepping it for Android Market). In Eclipse do a Project > Clean... , then turn off Build-Automatically so you can Build-All.


I got this error after renaming my project package. I fixed it by doing a clean in Eclipse. Then a full rebuild. After that pressing F11 launched the application on the device. (I also uninstalled the application from the device before that but I don't think that was the problem).


I solved this by unchecking the "Is Library" in Project->Properties->Android


Really a confusing Error...and what worked for me is : Rename the app package name in Manifest xml file to some other name, any! Save project, try to run it, mine gave lots of errors and didn't run! Again roll back to old name...save and run!


Cleaning the project didn't work for me. I was able to fix this issue by doing the following:

Add #!/system/bin/sh as the first line /system/bin/am
Add #!/system/bin/sh as the first line /system/bin/pm

I was getting this issue when using some custom ROMs on my phone.

Hope this fixes your problem,
Joey


This is eclipse problem and one of the workaround of this is to rename your package in the manifest for example rename

package="com.hernblog.GreenThumbs" 

to

package="com.hernblog.GreenThumbs1"

compile and build this, then put it back to the name you wanted

package="com.hernblog.GreenThumbs"

works as a charm :)


I too got the same error. And able to resolve with following steps.

In phone that you are testing,

1.go to settings>Apps>Downloaded

2.Go to bottom, I found my app has been disabled.

3.Now uninstall it.

4.In the next run able to install it properly.

Thanks.


Check your package names. At one point you're using com.hernblog.GreenThumbs (unusual to have upper-case package names) then com.hernblog.Green.Thumbs and you even have an activity named com.hernblog.GreenThumbs.GreenThumbs!


I managed to fix this through some voo-doo magic combination of steps. I did many of the things mentioned as answers above, but I think the big fix happened when I updated to a new version of Android.

Thanks for the help guys. I appologize for not having a clear answer on how to fix this problem.


Ok, here's my answer. I was pulling my hair out trying to find the answer to this. I found at his link that the person basically had to create a new project and copy all of the old files into that. So, that's what I did, and it worked! I couldn't believe it. It took me a long time to find it.

However, while working on my new project, I made a change and the same error occurred again. Luckily, I know what change I made, and I undid it and the error cleared.

I added another application tag to the android manifest and it then generated the error. I simply undid it and the error went away.


I opened my app in Google Play, and press "enable"... Wow! I founded in manifest: android:enabled="false" ... and deleted it!)


I had to reset my device/phone.

Background on how I confused my device:

  1. I pushed the APP.apk to /system/app (this was the wrong place I guess)
  2. I also used eclipse to deploy directly via adb
  3. I then deinstalled manually these apps via settings
  4. then I ran into the cited error "New package not yet registered with the system."


My answer: try test on your friend's device.

I also have the same problem. My Phone is LG lu-3000. This symptom occurred after I moved my project from Mac to Windows. After stuck on 10 days I found it runs on Android Virtual Device(but too slow to test anything) and now spent some days more and found out it DOES RUN on the other device!!

Before I tested on AVB and Motorola Bionic, I factory-reset my phone and did everything above. But it didn't change any result. It runs on neither Mac nor Windows.

More disastrous thing is now none of my android project is run on my device.. It is almost 2 years gone from I purchased this device.


If you have deleted the application by hand from the connected device and you still get the same error, please restart the connected device, and it will work correctly!


Check "android:installLocation" in your AndroidManifest.xml.

"preferExternal" will cause the problem.


I too had this problem immediately after changing the package name of my app. In Eclipse go to Project--> Clean, then turn off Build-Automatically so you can Build-All and don't forget to restart the eclipse. Then its working fine for me..


I solved this problem by setting the minimum SDK level of the project lower than the phone's SDK level.


Also try to free memory from the device, uninstall some apps to do this. solved the issue for me.


Make sure you have

<uses-sdk
    android:minSdkVersion="yourMinSDKver"
    android:targetSdkVersion="youtTargetSDKver" />

on top, in your manifest.xml file. I did swap it by mistake and got this very same error.


I made a really silly mistake. I laughed at when i caught it. There were two application tags in one application!!! have a look

<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>

which should be

<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>

so i fixed my project. I hope this will be useful to you.


Check your Manifest file. If it has multiple Tags it will face this as it will look for Class in the first Application tag it finds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜