Application doesn't show up in Home Screen - android

Problem
My mobile application called "Pipe" doesn't show up on Home Screen
How is it before
Before i tried to modify AndroidManifest.xml it working fine before, it's on the Home Screen
What i wanted
App to show up on Home Screen
AndroidManifest.xml
<?xml version='1.0' encoding='utf-8'?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gell.browserx">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".App"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:largeHeap="true"
android:name=".Applications"
android:resizeableActivity="true">
<activity
android:name=".ui.activity.MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<data android:scheme="pipe" />
</intent-filter>
</activity>
<activity
android:name=".ui.activity.SettingActivity"
android:label="Pipe Setting">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="pipe-setting" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".common.crash.CrashHandler$CrashActiviy"/>
<activity
android:name=".DebugActivity"
android:screenOrientation="portrait"/>
<meta-data
android:name="android.max_aspect"
android:value="4.0"/>
</application>
</manifest>

You should not pass android:scheme inside the launcher activity intent-filter. You need to either remove this or pass it in a different intent-filter. Have a look at this answer too.

Related

Android - launcher icon doesn't reappear after manual uninstall

The launcher icon of my app is not showing on any homescreens of my device, even though it's running. Going into app info, I can see that it is displaying the correct launcher icon.
My AndroidManifest.xml looks as follows:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".Activities.SelectRoomScreen"
android:screenOrientation="landscape"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<category android:name="android.intent.category.HOME" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>
Screenshot of mipmap
Screenshot of where it should appear next to My Application
As far as I can see, it should work. I've also tried adjusting the intent filter (removing any line except NDEF_DISCOVERED, HOME and LAUNCHER) but I'm either given an error or nothing is changing. What am I not seeing?
Thanks in advance!
In your manifest file, roundIcon is missing
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:allowBackup="true"
android:icon="#mipmap/logo"
android:label="#string/app_name"
android:roundIcon="#mipmap/logo"
android:supportsRtl="true"
android:theme="#style/Theme.Note">
<activity android:name=".activity.NoteActivity"></activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.SettingsActivity"></activity>
</application>

Android app opens app info screen on launch instead of launching main Activity

I am not sure if it is an issue, but this is the first time I ran into it.
I am halfway through developing an app. When I disconnect my app from Android Studio and my PC after some coding stuff, if I try to open my app on my phone, it launches app info screen (screen where we see force stop, clear memory) instead of launching my main activity and I couldn't use the app. And when I relaunch my activity by connecting with Android Studio, it works fine.
I worked on other apps too but did not encounter something like this.
Here is the code from my app manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.meanings_downloader">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:requestLegacyExternalStorage="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Music_Activity"></activity>
<activity
android:name=".SettingsActivity"
android:label="#string/title_activity_settings" />
<activity android:name=".settings" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".Music" >
<intent-filter>
<action android:name="android.media.browse.MediaBrowserServic"/>
</intent-filter>
</service>
</application>
Is it an issue or am I doing something wrong ?
Your intent filter is set up incorrectly, meaning that it's not matching the filter for a launcher activity. You probably meant to create two different intent filters, i.e.,
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<data android:mimeType="image/*"/>
</intent-filter>

When I start my app, it doesnt work. But if I include it through an icon, then everything works

I start the app on phone through Android Studio, it is shown an error in app. If I open application through an icon on my phone, then it works. I think that a problem in AndroidManifest.xml
P.S. If devices isn't in Lolipop, then it doesn't work anyhow.
UPD: I publish my app in Google Play. In Developer Console I received a notification message that an error in Main Activity, onCreate. But I don't found anything here.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.engineers.great.firstapp"
>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<!--Below MA which started at first. I can can return here, if I use a back button -->
<activity android:name="com.engineers.great.firstapp.MainActivity"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<!-- It's not a main menu lol if you click from MA on "START" then you will be here -->
<activity android:name=".MainMenu"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Below from MA1_! to MA2 are questions and results of my test. I set intent extras in everyone. I don't know, maybe it's important -->
<activity android:name=".MainActivity1_1"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
<activity android:name=".MainActivity1_2"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
<activity android:name=".MainActivity1_3"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
<activity android:name=".MainActivity2"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
<!-- It's many buttons with different results of test -->
<activity android:name=".Sociotypes"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
You are not using any Launcher intent filter in first activity.
Add this in the activity you want to launch first :
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>

Android manifest merging: removing LAUNCHER intent-filter doesn't take effect

In my android app I use a library project and I use one of it's activities. However in the library project that activity has MAIN action and LAUNCHER category intent-filter. So I added that activity to my manifest and removed the intent-filter. The manifests seem to be correctly merged into build/intermediates/manifests/full/debug/AndroidManifest.xml, and the activity looks as expected (without the intent-filter):
<activity
android:name="com.michaelrnovak.util.logger.Logger"
android:configChanges="orientation"
android:label="#string/show_log" >
</activity>
However when I start the app from AndroidStudio in the emulator, then instead of my AlertsActivity, the library's Logger activity is launched. What am I doing wrong?
This is the manifest of the library:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.michaelrnovak.util.logger"
android:versionCode="8"
android:versionName="1.5">
<uses-permission android:name="android.permission.READ_LOGS" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity android:name=".Logger"
android:label="#string/app_name"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
and my app's manifest has the following relevant activity definitions:
<activity
android:name=".AlertsActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
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>
</activity>
<activity android:name="com.michaelrnovak.util.logger.Logger"
android:label="#string/show_log"
android:configChanges="orientation"
tools:replace="android:label"
>
<intent-filter tools:node="removeAll" />
</activity>
Have you tried tools:node="remove" on the category node only? From my experience, it seems to work.
Something like this:
<activity android:name="com.michaelrnovak.util.logger.Logger"
android:label="#string/show_log"
android:configChanges="orientation"
tools:replace="android:label"
>
<intent-filter>
<category tools:node="remove" android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
I tried many ways on similar situation like you. I figured out that I must add tools:node="replace" in the Activity node to remove intent-filter's specific action and category. Try this :)
<activity
android:name="com.michaelrnovak.util.logger.Logger"
android:label="#string/show_log"
android:configChanges="orientation"
tools:replace="android:label"
tools:node="replace">
<!-- Rewrite the intent-filter you want -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Merging android manifest files, conflicting filter

I'm trying to combine android manifest files from 2 plugins in Unity, but there are two activities with the same intent-filter and I can only get 1 or the other to work at the same time....
Of the 2 conflicting activities, whichever is on top in the manifest file is the one that will work. So if activity from manifest #1 is on top, plugin #1 will work but not #2, and vice versa.
The two conflicting activities are:
<activity
android:name="com.devfo.andutils.DevfoUnityPlayerActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And:
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
android:label="#string/app_name" android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
is there any way I can merge the two and get them to work from the same app? I'm using Unity 3d.
For example in the manifest where you want to use only the first activity as launcher you have to add this 2 modifications:
At the beginning of the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
And for the activity for which you want to remove the intent filter add this code:
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
android:label="#string/app_name" android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter tools:node="removeAll">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The important part is to add the tools:node="removeAll" attribute in the intent-filter tag
Declare your manifest header like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
And then add one of the following appropriate attributes to the relevant Activity(s):
tools:merge="override"
tools:merge="remove"
Slightly different to #amarkovits answer, I've found success with:
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
android:label="#string/app_name" android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
tools:node="merge">
<intent-filter tools:node="remove"> ...
which I believe will try to merge it first, then replaces just the intent filter causing both Icons on the launcher screen
The Activity that has this intent-filter:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
is the main Activity that will start on application start up, you can't make both activities work at the same time.
what you should do is let only one Activity ( your main one have this filter) and leave the other one without it.
the second Activity will also be part of the application, but it will not be the first Activity you will see. You can start it by using the startActivity() method.
I have done this, the solution is that when you have multiple flavors, like
1. flavorA,
2. flavorB
and main application id is - com.android.vivek
and main flavorA is using com.android.vivek
and second flavorB is using com.android.vivek.flavorb
flavorA's manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.vivek">
<application xmlns:tools="http://schemas.android.com/tools"
android:allowBackup="true"
android:icon="#mipmap/flavorA_ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon" />
<activity
android:name=".ActivitySplash"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
then simply flavorB's manifest mention like below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.vivek">
<application xmlns:tools="http://schemas.android.com/tools"
android:allowBackup="true"
android:icon="#mipmap/flavorB_ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon" />
<activity
android:name=".flavorB.SecondActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivitySplash"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<intent-filter tools:node="remove">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
when you run flavorA or flavorB then it will work fine

Categories

Resources