I am making a basic custom launcher by following the given instructions on a site... The instructions say that the app can be launched, but when I try, I get an error saying the default activity not found.
I looked into the existing questions on stack overflow but none of them helped me. My manifest is this...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="omg_its_azzler.launcher">
<activty>
<application android:allowBackup="true"
android:name="omg_its_azzler.launcher.HomeActivity"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activty>
<activity>
android:name="omg_its_azzler.launcher.AppsActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
</activity>
</manifest>
You got the syntax of the manifest wrong. The application tag is the tag you keep all the activities inside of.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="omg_its_azzler.launcher">
<application android:allowBackup="true"
android:name="omg_its_azzler.launcher.HomeActivity"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"/>
<activity>
android:name="omg_its_azzler.launcher.AppsActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
The application tag is the root tag for all activities, and the intent filter goes inside the activity tag
All <activity>...</activity> should be in <application>...</application>.
In your manifest your <activity> tag is outside the <application>...</application> and closing tag </activity> is inside it.
This is the AndroidManifest.xml structure:
<uses-permission />
<permission />
<permission-tree />
<permission-group />
<instrumentation />
<uses-sdk />
<uses-configuration />
<uses-feature />
<supports-screens />
<compatible-screens />
<supports-gl-texture />
<application>
<activity>
<intent-filter>
<action />
<category />
<data />
</intent-filter>
<meta-data />
</activity>
<activity-alias>
<intent-filter> . . . </intent-filter>
<meta-data />
</activity-alias>
<service>
<intent-filter> . . . </intent-filter>
<meta-data/>
</service>
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
<provider>
<grant-uri-permission />
<meta-data />
<path-permission />
</provider>
<uses-library />
</application>
Related
After the update, the following warning appeared in the studio:
“App is not indexable by Google Search; consider adding ACTION-VIEW intent filter. See issue explanation for more details. more ... (Ctrl + F1) »
How to fix it?
My Api is 28.
Here is my manifests:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.omen.serverforcofe" >
<uses-permission android:name="android.permission.NFC"/>
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain"
/>
</intent-filter>
</activity>
</application>
</manifest>
<activity
android:name=".MyActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
Adding this intent filter to one of the activities declared in app manifest fixed this for me.
I was working on my code and got this error, I tried searching but didn't get it to work ... I tried a lot already and I got this error that is under the read and write storage permission that it has invalid character '' and a lot of my code suddenly turned red. it starts even at the manifestxmlns:android="http://schemas.android.com/apk/res/android" line but the error is not stated there. any ideas?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.biteme.biteme"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="24" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.Write_EXTERNAL_STORAGE " />
<!-- Optional permission for Analytics to run. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.biteme.biteme.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.biteme.biteme.permission.C2D_MESSAGE" />
<application
android:name="com.biteme.biteme.hashkey"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<activity
android:name="com.biteme.biteme.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
>
</activity>
<activity
android:name="com.biteme.biteme.Splashscreen"
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>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.biteme.biteme.MapsActivity"
android:label="BiteMe map"
android:screenOrientation="portrait" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="#style/com_facebook_activity_theme" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true" >
</activity>
<activity android:name="com.facebook.CustomTabMainActivity" />
<activity
android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="#style/Theme.IAPTheme" />
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.google.android.gms.appinvite.PreviewActivity"
android:exported="true"
android:theme="#style/Theme.AppInvite.Preview" >
<intent-filter>
<action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:excludeFromRecents="true"
android:exported="false"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<!--
Service handling Google Sign-In user revocation. For apps that do not integrate with
Google Sign-In, this service will never be started.
-->
<service
android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
android:exported="true"
android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
<receiver android:name="com.google.android.gms.cast.framework.media.MediaIntentReceiver" />
<service android:name="com.google.android.gms.cast.framework.media.MediaNotificationService" />
<service android:name="com.google.android.gms.cast.framework.ReconnectionService" />
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.biteme.biteme" />
</intent-filter>
</receiver>
<!--
Internal (not exported) receiver used by the app to start its own exported services
without risk of being spoofed.
-->
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />
<!--
FirebaseInstanceIdService performs security checks at runtime,
no need for explicit permissions despite exported="true"
-->
<service
android:name="com.google.firebase.iid.FirebaseInstanceIdService"
android:exported="true" >
<intent-filter android:priority="-500" >
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="com.biteme.biteme.firebaseinitprovider"
android:exported="false"
android:initOrder="100" />
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true"
android:exported="false" >
</receiver>
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
android:enabled="true"
android:permission="android.permission.INSTALL_PACKAGES" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false" />
<!--
FirebaseMessagingService performs security checks at runtime,
no need for explicit permissions despite exported="true"
-->
<service
android:name="com.google.firebase.messaging.FirebaseMessagingService"
android:exported="true" >
<intent-filter android:priority="-500" >
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name="com.google.android.gms.tagmanager.TagManagerService"
android:enabled="true"
android:exported="false" />
<activity
android:name="com.google.android.gms.tagmanager.TagManagerPreviewActivity"
android:noHistory="true" > <!-- optional, removes the previewActivity from the activity stack. -->
<intent-filter>
<data android:scheme="tagmanager.c.com.biteme.biteme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
</application>
</manifest>
You have a superfluous > between </intent-filter> and </activity> that you probably typed accidentally.
And the error actually is about <uses-permission android:name="android.permission.Write_EXTERNAL_STORAGE " /> where you have a superfluous space character in the end.
I am getting an error in manifest continiously.
Tried a lot but unable to fix it.
Manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bot.pokego"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="23" />
<uses-permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE" />
<permission
android:name="com.bot.pokego.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- Optional permission for Analytics to run. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.bot.pokego.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.bot.pokego.permission.C2D_MESSAGE" />
<application
android:name="com.bot.pokego.Utils.CommonForApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name="com.bot.pokego.main.StartActivity"
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>
<activity
android:name="com.bot.pokego.main.AboutActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAO9xX_OX2vwdUwPWVuPk2dHgzNpH3YKw8" />
<!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="#style/Theme.IAPTheme" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.google.android.gms.appinvite.PreviewActivity"
android:exported="true"
android:theme="#style/Theme.AppInvite.Preview" >
<intent-filter>
<action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:excludeFromRecents="true"
android:exported="false"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<!--
Service handling Google Sign-In user revocation. For apps that do not integrate with
Google Sign-In, this service will never be started.
-->
<service
android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
android:exported="true"
android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
<receiver android:name="com.google.android.gms.cast.framework.media.MediaIntentReceiver" />
<service android:name="com.google.android.gms.cast.framework.media.MediaNotificationService" />
<service android:name="com.google.android.gms.cast.framework.ReconnectionService" />
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.bot.pokego" />
</intent-filter>
</receiver>
<!--
Internal (not exported) receiver used by the app to start its own exported services
without risk of being spoofed.
-->
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />
<!--
FirebaseInstanceIdService performs security checks at runtime,
no need for explicit permissions despite exported="true"
-->
<service
android:name="com.google.firebase.iid.FirebaseInstanceIdService"
android:exported="true" >
<intent-filter android:priority="-500" >
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="com.bot.pokego.firebaseinitprovider"
android:exported="false"
android:initOrder="100" />
<service
android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
android:process=":background_crash" />
<service
android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
android:process=":background_crash" />
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true" >
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD" />
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false" />
<!--
FirebaseMessagingService performs security checks at runtime,
no need for explicit permissions despite exported="true"
-->
<service
android:name="com.google.firebase.messaging.FirebaseMessagingService"
android:exported="true" >
<intent-filter android:priority="-500" >
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name="com.google.android.gms.tagmanager.TagManagerService"
android:enabled="true"
android:exported="false" />
<activity
android:name="com.google.android.gms.tagmanager.TagManagerPreviewActivity"
android:noHistory="true" >
<!-- optional, removes the previewActivity from the activity stack. -->
<intent-filter>
<data android:scheme="tagmanager.c.com.bot.pokego" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
</application>
</manifest>
My efforts:
I tried to remove error by myself but failed again and again !
Searched on google ....searched all possible links for it.
Any help wil be appreciated ! Thanks in advance :)
..
Problem is with debug/AndroidManifest.xml.
My suspicion is that it has to do with the com.google.android.providers.gsf.permission.READ_GSERVICES permission. The newer documentation does not show that it's a requirement for location stuff: https://developers.google.com/maps/documentation/android-api/location
I was able to solve this issue by taking out all of the permissions and adding them one by one, rebuilding the project each time I added a permission back. The permission that gave me an issue, caused the error. Good luck :)
I am working the process of linking facebook login to my android application. In some tutorial I was asked to register my app with Facebook Developers website where I did everything but I couldnt find "Default Activity Class Name" in my Android Studio I have provided this below manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.evago.evago">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<!-- Front Page -->
<activity
android:name=".Frontpage"
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>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<!-- Search results activity -->
<activity
android:name=".SearchResultsActivity"
android:label="#string/title_activity_searchable"
android:launchMode="singleTop"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
</activity>
<!-- Search results activity Ends -->
</application>
Please help me in locating the "Default Activity Class Name"
should be the class containing:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
So its .Frontpage
Frontpage - This is the default activity name because its the launcher activity
So I have very weird problem with android app that I developed that I really do not understand how to address.
Description of the problem: When I run the app in my emulator(and many other emulators) the app works perfectly, but when I list it on Google Play and some user download the app, it automatically crashes. so I just wonder if my androidmainfest is properly written.
*the program written in esclipse, java, android.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app"
android:versionCode="6"
android:versionName="1.5" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.example.MainActivity"
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>
<activity
android:name="com.example.SurfaceExampleView"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.example.start" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.RulesGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.rules" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.PolicyGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.policy" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.RevenueGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.revenue" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.ShopGame"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.shop" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
You have posted only your manifest and not the logs. My guesses based on that is the problem may be within your package declaration, rest everything seems fine.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app".....
The package should be unique and its like what we call package in java world. You have declared it as com.app whereas your app is using com.example.... package. Also com.app maybe used by other app.The package name defines your application's identity.
Once you publish your application, you cannot change the package name. As the package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version. So you may have to upload another app with different package name.
Try getting logs(use crashlytics) for your crash and we can look into it for the root cause.