I have INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error when trying to install .apk.
<intent-filter>
<data scheme="myurlscheme" />
<action name="android.intent.action.VIEW" />
<category name="android.intent.category.DEFAULT" />
<category name="android.intent.category.BROWSABLE" />
</intent-filter>
If I remove it, everything is fine (except I can't open my app by the url :)
Here is my activity code:
<activity android:name="com.prime31.UnityPlayerNativeActivity" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:label="#string/app_name" 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>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<data scheme="myurlscheme" />
<action name="android.intent.action.VIEW" />
<category name="android.intent.category.DEFAULT" />
<category name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
What can be wrong with it? It works for many of android devices with OS > 2.2. Except only one device I'm talking about
Change:
<activity android:name="com.prime31.UnityPlayerNativeActivity" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:label="#string/app_name" 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>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<data scheme="myurlscheme" />
<action name="android.intent.action.VIEW" />
<category name="android.intent.category.DEFAULT" />
<category name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
To
<activity android:name="com.prime31.UnityPlayerNativeActivity" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:label="#string/app_name" 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" />
<data scheme="myurlscheme" />
<action name="android.intent.action.VIEW" />
<category name="android.intent.category.DEFAULT" />
<category name="android.intent.category.BROWSABLE" />
</intent-filter>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
Have to declared correct package name(should start from small letter) Please share whole android manifest to understand
<activity
android:name="packagename.Activity"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="abc" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
you can remove <data android:scheme="abc" /> from second <intent-filter> tag. This is running code, it may help you.
Related
How to translate the operation of 4 filters to url scheme, please cite source to develop url scheme
<activity android:excludeFromRecents="true" android:exported="true" android:finishOnTaskLaunch="true" android:name="com.google.android.voicesearch.handsfree.HandsFreeActivity" android:noHistory="true" android:process=":search" android:resizeableActivity="true" android:taskAffinity="com.google.android.voicesearch.handsfree" android:theme="#android:style/Theme.NoDisplay">
<intent-filter> <action android:name="android.intent.action.VOICE_COMMAND" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
<intent-filter> <action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
<intent-filter> <action android:name="com.google.android.search.core.action.PROXY_VOICE_BUTTON" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
<intent-filter> <action android:name="com.google.android.search.core.action.PROXY_VOICE_CANCEL" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
</activity>
I made a filemanager and I want it to respond to ACTION_GET_CONTENT intents. So I have this in my FileChooser activity in the AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
</intent-filter>
(In fact, in the docs it says that adding
<data android:type="image/*" />
serves to choose a photo, but Android Studio is telling me that Cannot resolve symbol 'image/*'.)
Yet, my app did not answer to this request. Why??
For example, it does not respond when I try to attach a file with K9.
My full AndroidManifest.xml, where you can see my tries:
<?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.floritfoto.apps.xvf"
android:versionCode="108"
android:versionName="3.9">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<application
tools:ignore="AllowBackup"
android:supportsRtl="false"
android:allowBackup="true"
android:requestLegacyExternalStorage="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="com.floritfoto.apps.xvf.ZForDebug"
android:theme="#style/MyThemeNonFS" >
<activity
android:name=".XvfActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!--
-->
</intent-filter>
</activity>
<activity
android:exported="true"
android:name=".Thumbs" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
<!--
-->
</intent-filter>
</activity>
<activity
android:name=".Foto"
android:exported="true"
tools:ignore="ExportedActivity">
<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
<activity
android:name="XvfPreferences"
android:label="Settings">
</activity>
<activity
android:name="FolderList"
android:label="Fima"
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:icon="#drawable/fima_launcher_128" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!--
-->
</intent-filter>
</activity>
<activity
android:name="FileChooser"
android:label="File Chooser"
android:exported="true">
<intent-filter>
<action android:name="org.openintents.action.PICK_FILE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="org.openintents.action.PICK_FILE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
</intent-filter>
<intent-filter>
<action android:name="org.openintents.action.PICK_FILE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="org.openintents.action.PICK_DIRECTORY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
</intent-filter>
<intent-filter>
<action android:name="org.openintents.action.PICK_DIRECTORY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:scheme="file" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths"/>
</provider>
</application>
</manifest>
EDIT: If I donĀ“t set fc.setType("...") my app is called...
According to this answer by #CommonsWare
, ACTION_GET_CONTENT is managed by the OS itself in modern versions of Android. So it seems that we are forced to use what the OS wants.
I should be able to show different activities of my application in the android sharesheet like the example image shown below.
Should I add a new activity? And how is it configured in androidmanifest.xml?
This is the MainActivity part of the androidmanifest.xml, where I have added intent to receive text and images. Now only one icon is shown in the sharesheet.
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
You can add multiple activities and for each activity add an intent filter. You can add label attribute for <intent-filter> to provide a custom label for each activity <intent-filter android:label="My Label 1">
<activity android:name=".BroadcastReceiverActivity1" >
<intent-filter android:label="My Label 1">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<activity android:name=".BroadcastReceiverActivity2" >
<intent-filter android:label="My Label 2">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
I have an app on GooglePlay, but the Open button is missing. It just says Uninstall.
This is my mainfest.xml:
<application
android:name=".preview_refresh"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Login_Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.url.com"
android:path="/launch"
android:scheme="https" />
</intent-filter>
</activity>
</application>
I figured out, the problem is:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
But I have these lines in my code. When I remove:
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.url.com"
android:path="/launch"
android:scheme="https" />
the open button is shown.
How can I fix it? I need these tags to open my app via link.
EDIT
I solved my problem, but now I have a new question:
Why do I have to separate the <intent-filter>? It's very confusing, because it shouldn't make any difference.
Ok, now I figured it out. The solution is to separate the <intent-filter>. Like this:
<activity android:name=".Login_Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.urlk.com"
android:path="/launch"
android:scheme="https" />
</intent-filter>
</activity>
I have launched an android application in to the google play store and it's currently live. How ever, the app has no name. In the store itself, it has a name, but once you downloaded it, it's gone. Like the icon shows next to all your other apps, but there is no name under the small icon.
Does anyone know where I can add this? I saw something about the android:label in my AndroidManifest, but I get errors when I change that. It's currently android:label="#string/app_name"
This is my entire AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.informatie.rodekruis"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:icon="#mipmap/app_logo" >
<activity
android:name="com.example.rodekruis.MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.BezoekActivity"
android:label="#string/title_activity_bezoek" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.BEZOEKACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.AfspraakActivity"
android:label="#string/title_activity_afspraak" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.AFSPRAAKACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.ContactActivity"
android:label="#string/title_activity_contact" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.CONTACTACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.MeningActivity"
android:label="#string/title_activity_mening" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.MENINGACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.RouteActivity"
android:label="#string/title_activity_route" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.ROUTEACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.SpecialistenActivity"
android:label="#string/title_activity_specialisten" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.SPECIALISTENACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.BWCActivity"
android:label="#string/title_activity_bwc" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.BWCACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.AgendaActivity"
android:label="#string/title_activity_agenda" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.AGENDAACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.InfoActivity"
android:label="#string/title_activity_informatie" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.INFOACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.VriendActivity"
android:label="#string/title_activity_vriend" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.VRIENDACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.FoldersActivity"
android:label="#string/title_activity_folders" >
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.FOLDERSACTIVITY" />
</intent-filter>
</activity>
<activity
android:name="com.example.rodekruis.NieuwsActivity"
android:label="#string/title_activity_nieuws">
<intent-filter>
<action android:name="android.intent.category.DEFAULT" />
<category android:name="com.example.rodekruis.NIEUWSACTIVITY" />
</intent-filter>
</activity>
</application>
</manifest>
Instead of your label in the application tag, Android is using your label of the activity, that has
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
in it. Android tries to be the most specific. And because, as you said, your value for the string resource
#string/title_activity_main
is empty (so an empty string basically, which is not an empty value) you don't see any label below your icon. You can check that against, if you open the application manager in the settings and search for your application. It should be named after your app_name resource.
You can now either change the value for your activity label, or instead (and I assume that is what you want to do), remove the label between <activity ... />.