Launcher intent is in manifest, but no launcher activity found - android

I'm pretty new to android development. I created a project using android studio, and chose my first activity to be a login activity. After changing some basic stuff in the layout/trying to add some functionality in java, thought I'd do a test run. While trying to build apk and install the app, it installs fine on my phone but AIDE (A development android app) says that no launcher activity is found. Here's my manifest file:
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize|stateVisible" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.categor.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
So what am I missing? I've searched a lot but I ant find an answer that applies to my scenario. Any help would be appreciated. Thanks

<category android:name="android.intent.categor.LAUNCHER" />
It Should be
<category android:name="android.intent.category.LAUNCHER" />

Related

Android app is not installed on emulator or device when I run it in Android Studio

I am developing an Android app. In my app, I am testing my app running on both device and emulator. This is my third android app development. When I developed other apps, app is automatically installed with launch icon on device or on emulator. But when I run my currently developing app, it is successfully run on both emulator or device.
But app is not installed with launch icon. I did not modify and settings to Android Studio. I am using Android Studio version 1.4. Now I need to check the launch icon and other related things. But I cannot check it, because I cannot see launch icon installed.
What is the possible error? How can I make my app installed with launch icon once I run it?
This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blog.waiyanhein.mmfashion.mmfashion" >
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="com.blog.waiyanhein.mmfashion.model.Config"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:largeHeap="true"
android:theme="#style/AppTheme" >
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<activity android:name=".InitialActivity"
android:exported="true"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</activity>
</application>
</manifest>
The tags to make an activity, a launcher activity should be inside intent-filter tag. You missed that. The correct way should be:
<activity android:name=".InitialActivity"
android:exported="true"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

Running app gives 2 app icons in Android Studio

I am running an app in Android Studio and it gives 2 app icons in Androi Studio.
Also, I have moved from Eclipse to Android Studio and now I'm having trouble with how to make the color of logcat same as in Eclipse.
My question is that there are 2 app icons when I run the app, and when I uninstall it, 2 of them have been removed. Is that normal in Android Studio?
I have found that Android Studio can copy keys from Eclipse.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mytrack.ph"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Google Map v.2 permissions -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- GCM permissions -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.example.gcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
<!-- Writing Persmission -->
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
<uses-permission android:name="android.permission.WRITE_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_CONTACT"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name="com.mytrack.ph.SplashActivity"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="#style/splashScreenTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.mytrack.ph.LoginActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_map_api_key"/>
<activity android:name="com.facebook.LoginActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id"/>
<service android:name="com.my.track.service.MyTrackService"></service>
<receiver
android:name="com.my.track.service.MyTrackGcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.my.track.service" />
</intent-filter>
</receiver>
<service android:name="com.my.track.service.MyTrackGcmIntentService" />
<activity android:name="NavigationMenuActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:launchMode="singleTop"
android:permission="com.google.android.c2dm.permission.SEND" >
></activity>
<receiver android:name="com.my.track.results.ConnectionChangeReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
</application>
</manifest>
I though this is normal in android studio. Running an app gives 2 launcher icons.
PS:
my AndroidManifest.xml is inside main folder and I used eclipse to export to gradle build.
Im using Android Studio 0.8.6
thanks.
I got it! yes at last , i have to study gradles and stuff.
Actually I have 2 android projects inside the Project, one is a library and the other one is the main app.
I found out that when i imported those projects Android Studio (I exported the lib to gradle build from eclipse) doesn't care if that is a lib project or a main project. (Correct me if im wrong ).
so the only thing to make it work is to remove the intent-filter of that lib-android-project.
EDIT:
#all
solved it ! thanks to everyone, I never knew there was another AndroidManifest.xml , i thought eclipse removed it. and i thought Exporting it to gradle will remove it because it is checked as a library.
thanks for all your help.
The <intent-filter> that affects creating multiple launcher icon is the following one:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Android Studio's manifest merger will always combine <intent-filter>s in library projects into main project's manifest. You may end up having multiple LAUNCHER intents in your synthesized manifest, thus having multiple launcher icons. To avoid this, simply remove the LAUNCHER intents from the library projects' manifest.
You declare two intent filter, used only one Intent filter in the activity, on AndroidManifest.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
If you used two or more intent filter in AndroidManifest, then you will have two app icon, So remove it & set one intent filter.
I hove this is usedful to you.
i agree, since i made 2 activity(one for splash, one for main). In manifest i forgot to delete
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
so in the end when i install app, i will have 2 app.
There is most likely an imported Library project that has this intent filter.
1. Open your app manifest
2. At the bottom left click on "Merged Manifest"
3. Search and find which library project has the attribute
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
4. Remove it and ensure that now the filter is only on your App's <Application >class activity.
In my case, it was just because, in the manifest file, two activities were declared as launcher. Actually, I clicked on the launcher checkbox while making new activity, thinking it will transfer the launcher tag from the previous activity to this, but it created both activities as launchers.
When running android and doing debug, there is an another AndroidManifest.xml under src/debug. Make sure this manifest file matches the main one under src/main.
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MainActivity">
<!You need to delete launcher intent filter from every other activity ->
</activity>
The "android.intent.category.LAUNCHER" intent filter decides which activity will launch when you tap on the application icon. If there are more than 1 entries, OS will create more than one app icon after installation. You need to make sure that there is a single entry of above intent filter in the Manifest file.

App Not Showing in Apps

I'm debugging using my Samsung Galaxy S5 and every time I run it through Android Studio it works fine and it pops up the app, but then when I click out of it it doesn't show in all of my apps like other apps I've installed to my device. The app will show in my task manager after I close out of it but it still won't show in all of my apps. Really could use some help on this one, thanks.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="us.bisonsoftware.tab" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Husky Athletics"
android:theme="#style/CustomActionBarTheme">
<activity
android:name=".TabBarExample"
android:label="Husky Athletics"
android:icon="#drawable/ic_launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<data android:scheme="geo"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FirstTab" />
<activity android:name=".SecondTab" />
<activity android:name=".ThirdTab" />
</application>
<uses-permission android:name="android.permission.INTERNET" ></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
Try to make your activity name complete like this:
<activity
android:name="com.example.myapp.TabBarExample"
... >
</activity>
I dont know your package name. You have to fill it by yourself.

Googlemaps on android is showing grey screen

I've just gotten my google maps application to not crash on startup, but now, when it opens, it just shows a grey/white background and buttons for zooming. I searched the web and I found that this may be a problem with my API-key, so I got a new key from google, but this didn't work either.
Here's a screenshot of how it looks.
link to image (I'm a new user, so I couldn't post a picture here)
Here's my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidbasic12"
android:versionCode="1"
android:versionName="1.0"
>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="come.example.androidbasics12.permission.MAPS_RECIEVE"
android:protectionLevel="signature"/>
<uses-permission
android:name="com.example.androidbasics12.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/new_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- First xml to be loaded -->
<activity
android:name="com.example.androidbasic12.MainActivity"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Opens main menu after splash has loaded -->
<activity
android:name=".myMenu"
android:label="#string/app_name"
android:screenOrientation="portrait"> >
<intent-filter>
<action android:name="com.example.androidbasic12.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Opens test -->
<activity
android:name=".tutOne"
android:label="#string/app_name"
android:screenOrientation="portrait"> >
<intent-filter>
<action android:name="com.example.androidbasic12.TUTONE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Opens map page -->
<activity
android:name=".map"
android:label="#string/app_name"
android:screenOrientation="portrait"> >
<intent-filter>
<action android:name="com.example.androidbasic12.MAPS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBcMOBc8WVLUIRUfs0Zgap3cnhwm4dWLag"/>
</application>
</manifest>
Anyone got any tips for this?
I've got the same problem as you, everything worked ok on emulator but on the real device it was gray surface with zoom buttons.
Then I tried other devices and it works. All other phones have original (stock) firmware, only I have one with custom firmware.
lease first check that everything works fine on emulator, then check on the device with stock firmware and let us know the result.
The problem may not be with your API key, but the authorized apps in the API console. Make sure you registered the correct key(s) and package names with the Google API console. Specifically, if you are compiling and launching directly from eclipse, you are probably signing in debug mode. If so, you need to add your debug key hash + package name to the allowed applications in the API console.

HelloMapView problem

I'm a new Android developer and I have been trying to get the HelloMapView example to work properly.
I got the API Key for debug following:
http://code.google.com/intl/es-ES/android/add-ons/google-apis/mapkey.html
I get the application running both in the emulator and on a mobile phone, but in both cases, I only see the overlay item of the example but I can't see the map.
I have already done this twice and the result is the same.
I have declared the use of the library and the use of internet permisson in the manifest.
Do you have any idea for solving my problem?
PROBLEM SOLVED, I had a mistake in the Manifest.
This is the right one:
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".HelloMapView"
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>
<uses-sdk android:minSdkVersion="8" />
Thank you every one :D

Categories

Resources