Android app not showing on my device. No Launcher Activity Found - android

I am simply following the Android Developer training guide, and I am already running into troubles on the second step.
I followed the guide (I don't even have to do anything..) and clicked on Run, selected my Galaxy S4 from the screen, and clicked okay. I get the following error
[2014-07-06 19:56:27 - MyFirstApp] Android Launch!
[2014-07-06 19:56:27 - MyFirstApp] adb is running normally.
[2014-07-06 19:56:27 - MyFirstApp] No Launcher activity found!
[2014-07-06 19:56:27 - MyFirstApp] The launch will only sync the application package on the device!
[2014-07-06 19:56:27 - MyFirstApp] Performing sync
[2014-07-06 19:56:27 - MyFirstApp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-07-06 19:56:31 - MyFirstApp] Application already deployed. No need to reinstall.
[2014-07-06 19:56:31 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-07-06 19:56:31 - MyFirstApp] Done!
I honestly have no idea what I am doing wrong, as I have absolutely no experiences with android.
The only thing that is different is in the tutorial their targetSdkVersion is 19, but I am using 21
The following is my AndroidManefiest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
</manifest>

You forgot to declare your activity to your Manifest.xml.
Everytime you create an activity (blablabla class extends Activity) you have to declare it to your Android Manifest.xml, in order to de device be able to track your App's life cicle.
What we call Activity is a class that provide information to host a window, the class should extends Activity, all of this classes must be declared on the Manifest.xml file as below:
<application>
...
<activity
android:name="com.yourpackage.ClassName">
</activity>
</application>
Probably your activity class is called MainActivity, you just have to add this to your code, between <application> </application> tag:
<activity
android:name="com.example.myfirstapp.MainActivity"
android:label="#string/app_name"> <!-- This is the text that will appear on your action bar -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The <intent-filter> tells to android that this class is the "main entrance", the first activity that need to be loaded to your app be launched, only the first activity need the <intent-filter> tag, the others just need the fist example I gave.
If you are starting with Android development, I recommend you to read about ActionBar and What to do when the device is rotated
This and this may help you in the future.
Good coding :)

Put the following intent-filter for your activity to be launched.
<activity class=".YourActivity" android:label="your activity label">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
{ action=android.app.action.MAIN } matches all of the activities that
can be used as top-level entry points into an application.
{ action=android.app.action.MAIN,
category=android.app.category.LAUNCHER } is the actual intent used by
the Launcher to populate its top-level list.
Also, please refer to Intent

Related

Unable to launch app on device

I am trying to run a demo project to implement widgets, it compiles successfully but did not launch, also I did not find it installed in my phone.
I am following this tutorial http://www.tutorialspoint.com/android/android_widgets.htm
A also this tutorial https://github.com/TechIsFun/android-widget-example but getting the same problem.
My console shows
[2014-11-23 11:01:30 - WidgetExample] Performing sync
[2014-11-23 11:01:30 - WidgetExample] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-11-23 11:01:34 - WidgetExample] Uploading WidgetExample.apk onto device '1C9E_9E18_MicromaxA111'
[2014-11-23 11:01:34 - WidgetExample] Installing WidgetExample.apk...
[2014-11-23 11:01:37 - WidgetExample] Success!
[2014-11-23 11:01:37 - WidgetExample] \WidgetExample\bin\WidgetExample.apk installed on device
[2014-11-23 11:01:37 - WidgetExample] Done!
I think there is some problem with the manifest file ?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.widgetexample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver
android:name="MyWidgetProvider"
android:icon="#drawable/ic_launcher"
android:label="Example Widget" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_info" />
</receiver>
</application>
</manifest>
Your console message shows that your apk is isntalled sccuessfully on the device. Now the question is why it is not getting launched?
To launch any application, it should have at least one activity with action as main and category as launcher.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
In your case, your application don't have any activity assoicated with it.
I think this is the casue why its not getting launched afer sccuessful installation. also thats why its not showing your application on application list.
As your application have only one widget hence it will show it under widgets list. Please check.
Hope it helps you.

Where can I find the apk file on my Android phone?

I am trying to develop android applications with eclipse (following this tutorial ). Clicking the 'Run' button inside eclipse (running on Linux) and choosing an android device, eclipse tells me that the application is successfully installed on the device.
[2014-07-02 19:26:55 - MyFirstApp] Installing MyFirstApp.apk...
[2014-07-02 19:27:01 - MyFirstApp] Success!
[2014-07-02 19:27:02 - MyFirstApp] /MyFirstApp/bin/MyFirstApp.apk installed on device
[2014-07-02 19:27:02 - MyFirstApp] Done!
However, I cannot find this application in the list of installed applications on the phone. It only shows up in Settings -> Applications where I am only able to remove it, but not to start it. Maybe I need to do something special in order to let the app show up normally and useable?
As a next step, I installed an 'AppInstaller' to install the apk file. But I do now know which folder on the android phone the apk has been copied to. Where did eclipse put the apk in?
This is in the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
</manifest>
The most likely cause is that you didn't specify a launcher activity in the Manifest.
<activity android:name="... >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
From the documentation:
The ACTION_MAIN action indicates this is the main entry point and does not expect any intent data.
The CATEGORY_LAUNCHER category indicates that this activity's icon should be placed in the system's app launcher. If the
element does not specify an icon with icon, then the system uses the
icon from the element.

Unable to run application after installing on phone

When I clicked run, the apk used to auto start up on my phone before, but now it just remains unchanged on the developer option,
once i click run on eclipse, it shows the following on the console:
[2014-03-11 16:26:36 - MyFirstApp] ------------------------------
[2014-03-11 16:26:36 - MyFirstApp] Android Launch!
[2014-03-11 16:26:36 - MyFirstApp] adb is running normally.
[2014-03-11 16:26:36 - MyFirstApp] No Launcher activity found!
[2014-03-11 16:26:36 - MyFirstApp] The launch will only sync the application package on
[2014-03-11 16:26:36 - MyFirstApp] Performing sync
[2014-03-11 16:26:36 - MyFirstApp] Automatic Target Mode: Unable to detect device
[2014-03-11 16:26:38 - MyFirstApp] Uploading MyFirstApp.apk onto device 'EP73226B61'
[2014-03-11 16:26:38 - MyFirstApp] Installing MyFirstApp.apk...
[2014-03-11 16:26:41 - MyFirstApp] Success!
[2014-03-11 16:26:41 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-03-11 16:26:41 - MyFirstApp] Done!
But as i said nothing come up on my phone,
then I try other method like putting the apk into my download file and installed it , it says, Do you want to install an update to this existing application? Your existing data will not be lost. it does not require any special access. once i click on install, it shows application installed and leaving my two button, Done and Open. But the "open" button is non-clickable
Is wired, I can't find it neither in internal storage and SD card, not even in my install app list.
My setting
USB debugging is clicked
stay awaked is clicked
This is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:name="com.example.myfirstapp.MainActivity"
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="com.example.myfirstapp.Display1MessageActivity"
android:label="#string/title_activity_display1_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" />
</activity>
</application>
</manifest>
my android version is 4.3 is sony ZR
Check your AndroidManifest.xml file. It should contain something like this:
<application details omitted>
<activity details omitted>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
If you don't have an intent filter like the one shown above, Android does not know which activity to start to launch your application.

Using Hardware Device but cannot find installed app

I followed the procedure on Using Hardware Device from google android's page, after having problems with emulator. After having followed everything provided on google's hardware page, i created a new project and ran it, it gave me the following,
[2014-03-17 18:35:18 - FirstAppProject] ------------------------------
[2014-03-17 18:35:18 - FirstAppProject] Android Launch!
[2014-03-17 18:35:18 - FirstAppProject] adb is running normally.
[2014-03-17 18:35:18 - FirstAppProject] No Launcher activity found!
[2014-03-17 18:35:18 - FirstAppProject] The launch will only sync the application package on the device!
[2014-03-17 18:35:18 - FirstAppProject] Performing sync
[2014-03-17 18:35:18 - FirstAppProject] Automatic Target Mode: using device '0123456789ABCDEF'
[2014-03-17 18:35:18 - FirstAppProject] Uploading FirstAppProject.apk onto device '0123456789ABCDEF'
[2014-03-17 18:35:19 - FirstAppProject] Installing FirstAppProject.apk...
[2014-03-17 18:35:25 - FirstAppProject] Success!
[2014-03-17 18:35:25 - FirstAppProject] \FirstAppProject\bin\FirstAppProject.apk installed on device
[2014-03-17 18:35:25 - FirstAppProject] Done!
Which seem to me that the app is installed on my device, but i cant seem to find the app on my device so that i can test it.
What to do ?
If that is your manifest:
<manifest xmlns:android="schemas.android.com/apk/res/android";
package="com.faizanchaki.firstappproject" 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" >
<!-- no activities declared here -->
</application>
</manifest>
Then you are missing the declaration of a main activity like:
<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>
you should declare the main activity in your Manifest so that your app icon will appear in the android launcher and you will be able to actually start your app. Just put your Activity name and add it to the main manifest where I put the comment.

application not installing on android emulator

I am running tab based application in android.When i try to install the application on the emulator it gives output in the console as
[2011-03-08 12:40:35 - TabBar] Application already deployed. No need to reinstall.
[2011-03-08 12:40:35 - TabBar] \TabBar\bin\TabBar.apk installed on device
[2011-03-08 12:40:35 - TabBar] Done!
Can anyone tell how should i pursue
Thanks in advance
Tushar
I'm also tackled with this same problem and finally I found the solution for it. When you creating a new android project using Eclipes and if you didn't create a activity for your first window, your project's Manifest also don't create proper codings for you to application launch up.
So, you should hardcode them yourself.
First check these codes are available or not in your Project's Manifest file, within your main activity tags.
**
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
**
These two code lines are very important. Because these two lines are calling to android OS to launch this app.
So, Make sure these codes are available in your project's Manifest file. If it's not this below Manifest file code will gets you rough idea to fix this problem.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mershanfernando.testingappz"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/ic_launcher" android:label="#string/app_name">
<activity android:name=".Main"
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>

Categories

Resources