I cleared all the bugs... Recently before running this app it was showing "No default activity found" I changed configuration to "Nothing" & also added Android Manifest.xml file.
After successful build, Emulator shows app in settings>>app management.
But,
There is nothing in Apps Menu. Even I tried manually installing this app in my device. But it says "App Not Installed"
Share your experience. Help me out. Thank you.
Please include all manifest functions into this code, if I am missing something. This app is cloud storage app.
This is my manifest file :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>```
Sometimes android studio has quircks and bugs.
In this case when it complains of activity not found even though you know it's there do the following:
clean build - see if it works
remove cable of device reattach cable of device - see if it works
restart android studio - see if it works
invalidate caches and restart - see if it works
if none of the above work, that means you have some place in that activity that in theory compiles, in practice there is a problem with it.
Add this in your activity tag
<category android:name="android.intent.category.DEFAULT" />
So I was doing some refactoring of package names in my project and now i'm no longer able to install my app. Right around the same time that I updated to the most current version of android studio. I believe that may be the problem because I think i did the refactoring before the upgrade, I just don't remember 100%
Here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dodgingfire" >
<application
android:allowBackup="true"
android:icon="#mipmap/dodging_fire_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".gamemain.GameMainActivity"
android:label="#string/app_name"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is how I have my packages organized
http://prntscr.com/gcrw99
This is the full error message when I try to run my app
Installation failed with message Failed to finalize session : INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: Invalid manifest package: must have at least one '.' separator.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
Even when I accept to delete the existing application, It still gives me an error and doesn't install my app let alone run it.
The package name in your source manifest file is not actually the one that ends up in the APK being installed. During manifest merging process, the final package name is based on the applicationId value in your app's build.gradle file.
As the error message says, you need at least one . in the package name.
Other reasons for INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME can be found in PackageParser#validateName() source.
I have scoured the internet for this, but none of the "answers" I have found so far have fixed it for me. My app installs and runs 100% on my phone, which runs Android 4.1.2. It appears to install ok on my tablet too, which runs Android 4.3. But when I try to run it on the tablet, I get the "Application is not installed" error. What is even stranger is that if I run it using the App Manager inside ES File Explorer, it runs fine!
So my suspicion is that Android 4.3 is more strict about something that 4.1.2 lets through. But what? I just can't find it. And why it should run from within ES File Explorer is just weird. The app manifest is below. I have tried several different values for the target SDK, but nothing makes any difference. The app is signed using the Export Wizard in Eclipse, using a certificate created there.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="marshallarts.wordfinder"
android:versionCode="10"
android:versionName="1.10" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
android:theme="#style/AppTheme"
android:hasCode="true" >
<activity
android:name=".StartActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".EnterActivity"
android:label="#string/title_activity_enter"
android:theme="#android:style/Theme.Dialog">
</activity>
<activity
android:name=".PlayActivity"
android:label="#string/title_activity_play" >
</activity>
</application>
</manifest>
Would add as a comment but don't have enough rep at the moment.
Have you changed your default launcher activity in your project recently? It could be that the link in your Android Home application is referencing the old activity.
Well I have solved this at last. It was (of course) my error - I had not correctly understood how to specify the app's permissions, and had not set them properly in the manifest. Corrected that, and it now runs happily. It is still a minor mystery why it ran on my phone - seems to me it should not have - but no matter, I am now on the right track.
I come across a weird problem, I got an application allowing to freely change the font size on Android Device (Font Size Setter). It uses introspection to call some internal Android apis. To do this call, it needs the following permission : android.permission.CHANGE_CONFIGURATION. It worked like a charm under Android 4.0 and up to 4.2 where it does not work anymore.
Digging into logs I found out that I can't update font size because it misses this permission. Debbuging to check effective permissions, I got these when inspecting the PackageInfo corresponding to my app
requestedPermissions = {java.lang.String[2]#830038778728}
[0] = {java.lang.String#830038778760}"android.permission.CHANGE_CONFIGURATION"
[1] = {java.lang.String#830038778896}"android.permission.WRITE_SETTINGS"
requestedPermissionsFlags = {int[2]#830038779016}
[0] = 1
[1] = 3
Does somebody got any clue about what's going on, or any workaround idea ?
Thanks a lot for reading me.
Per request, the AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.gatay.android.fss"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14"/>
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<application android:label="#string/app_name" android:icon="#drawable/app_icon">
<activity android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Check this post http://blog.sightidea.com/?p=44
You can ask your user to grant permission to the app with adb tool:
>adb shell
>pm grant com.yourapp.packagename android.permission.CHANGE_CONFIGURATION
The protection level of CHANGE_CONFIGURATION permission has been changed to "system|signature|development" (v4.2) from "dangerous" (v4.1 and below) since Android v4.2
It looks like that no way for 3rd part apps to get CHANGE_CONFIGURATION permission on Android 4.2+ devices. :-(
At least at present, CHANGE_CONFIGURATION requires for your app either to be signed by the firmware signing key or be installed on a system partition. You can see this by examining the framework manifest, where these permissions are defined.
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:
I pushed the APP.apk to /system/app (this was the wrong place I guess)
I also used eclipse to deploy directly via adb
I then deinstalled manually these apps via settings
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.