No launcher activity found while loading Application - android

This is what my AndroinManifest.xml looks like
<manifest package="com.dz122596.bubblebop"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:icon="#drawable/ic_launcher" <!-- THIS ICON(IMAGE) WILL BE SHOWN IN YOUR APPS -->
android:label="#string/app_name" <!-- HERE LABEL(APP NAME) -->
<activity
android:name=".startingpoint" <!-- (.)dot means current dir, if your activity is in another package then give cull package name ex: com.xxx.Activity -->
android:label="#string/app_name"
android:screenOrientation="portrait"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</manifest>
And startingpoint.java the activity Iam trying to launch is in the same package but when I run it says no launcher activity found.

Your manifest file's code says that your forgot to end the Application tag. You need to write </application> before </manifest> tag. Just add it and your problem will be solved.
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.dz122596.bubblebop"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".startingpoint"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application> <!-- Add this closing tag -->
</manifest>

just make few changes to ur manifest file. follow below manifewst file.
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" />
<application android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<activity android:name="com.dz122596.bubblebop.startingpoint"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Related

Android showing error while running

i have 2 activities AndroidSlite.java and SqLiteAdapter.java.. my manifest.xml file is given below.it shows No launcher activity found .while running
please help me with the code
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cerebtec.androidsqlite"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity android:name="AndroidSQLite"></activity>
</application>
</manifest>
You have to enclose the intent filter around the launcher activity, in order to declare your launcher activity. E.g.
<activity android:name="AndroidSQLite"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
this way you are telling android that the launcher activity is AndroidSQLite
Use :
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

how to add an activity to the android manifest

How do I add:
<activity
android:name=".MainActivity2"
android:label="#string/title_activity_main">
</activity>
into the AndroidManifest.xml
which currently looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bac"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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>
I'm fairly new to android programming and have yet to figure out a lot of stuff about transferring between pages and other things like that. Thanks for any help you give!
Just Add another Activity tag under your application tag
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bac"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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>
<activity
android:name=".MainActivity2"
android:label="#string/title_activity_main">
</activity>
</application>
</manifest>
If you are new to android and trying to understand about manifest
Have a look at ANDROID-DEVELOPERS-SITE ..... Click here
Have a look at youtube-tutorial too hope this helps
It has all the information you need to get started knowing more about the manifest file
You need to add your Activity inside Application tag.
The activity is the child node of the application node. The multiple activities can specify by multiple nodes of activity.
Read this : manifest-intro
your manifest will be look like
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bac"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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>
<!-- Add your activities here -->
<activity
android:name=".MainActivity2"
android:label="#string/title_activity_main">
</activity>
</application>
</manifest>
you can add any number of activity inside your application tag in AndroidManifest.xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bac"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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>
<!-- activity goes here-->
<activity
android:name=".MainActivity2"
android:label="#string/title_activity_main">
</activity>
</application>
</manifest>
to add an activity to the Manifest , just copy the content of the exesting activity in the manifest and remove the intent filter like this
---the original
<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>
---the new
<activity
android:name=".yourNewActivityName"
android:label="#string/app_name" >
</activity>
you need add this in the application tag.
you need to change the android:name property to your new activity's name

Android: No Launcher activity found, no problems in Manifest

Here's my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fionaheiss.shovelshovel"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:label="DisplayMap"
android:name="com.seanheiss.shovelshovel.DisplayMap"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:configChanges="keyboard|keyboardHidden|orientation" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I've tried the "name" field as above and just as ".DisplayMap". It is definitely spelled correctly. Could it be because I'm using Slick2D? The file DisplayMap.java extends BasicGame from the Slick2D engine, and has a main method. Maybe it's not an actual activity or something, but I'm not sure.
Any ideas? Thank you very much!
You forgot to close the Activity tag:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:label="DisplayMap"
android:name="com.seanheiss.shovelshovel.DisplayMap"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:configChanges="keyboard|keyboardHidden|orientation" > // Also fix this here
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> // <-- here
</application>
Good Morning,
You have to close the <activity> tag after the <intent-filter>
<activity >
<intent-filter>
-------------------
------------------
</intent-filter>
</activity>

Android manifest.xml problems

Following this: http://developer.android.com/training/basics/firstapp/starting-activity.html I am confused when editing the Android Manifest.xml file. It says that the file should contain this:
<application ... >
<activity android:name="com.example.myapp.DisplayMessageActivity" />
...
</application>
My android manifest.xml looks like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nick.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<application android:label="#string/app_name">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" />
...
</application>
</manifest>
and when I run the app everything goes fine except it says : "No Launcher activity found!
The launch will only sync the application package on the device!" Is this something missing from the android manifest.xml file?
declare Your Activity in AndroidManifest.xml as for Showing In Launcher as:
<application android:label="#string/app_name">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
see for more info how we set an activity which so in Launcher :
http://developer.android.com/reference/android/content/Intent.html
http://developer.android.com/reference/android/app/Activity.html
You need to change you manifest to the following. Doing this will tell Android that you want this Activity to be displayed in the Launcher using your icon.
<application android:label="#string/app_name" android:icon="drawable icon resource here">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" android:label="Your Label">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
In the docs the used ... to show that your normal code goes here. What you're doing is fine for non-launcher Activities.
You are missing the launcher intent and therefore the app finds no activity to launch at the start.
You need to lay out the activity like so:
<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>
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
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>

how to start a MapActvity from Activity

i'm trying to start a map activity from a normal Activity.
But keep getting the error:
10-20 10:47:08.828: ERROR/dalvikvm(1102): Could not find class 'com.xxApp.MapAnalyseActivity', referenced from method com.xxApp.xxAppActivity$1.run
10-20 10:47:11.578: ERROR/AndroidRuntime(1102): java.lang.NoClassDefFoundError: com.xxApp.MapAnalyseActivity
when i try to do:
startActivity(new Intent(xxAppActivity.this, MapAnalyseActivity.class));
xxAppActivity.this.finish();
Here is my manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxApp"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".xxAppActivity" android:label="#string/app_name" android:theme="#style/xxTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/mapAnalyse" android:name="MapAnalyseActivity" android:configChanges="orientation|keyboardHidden" android:theme="#style/xxTheme">
<intent-filter>
<action android:name="com.xxApp.MapAnalyseActivity" />
</intent-filter>
</activity>
</application>
Your manifest.xml should look like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxApp"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".xxAppActivity" android:label="#string/app_name" android:theme="#style/xxTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/mapAnalyse" android:name="MapAnalyseActivity" android:configChanges="orientation|keyboardHidden" android:theme="#style/xxTheme"/>
<uses-library android:name="com.google.android.maps"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Check that MapActivity is in the Same Folder ?
or try giving full path in manifest as
com.packagename.mapactivity

Categories

Resources