Issue: You uploaded an APK or Android App Bundle which has an activity, activity alias, service, or broadcast receiver with intent filter, but without the 'android: exported' property set. This file can't be installed on Android 12 or higher. See developer.android.com/about/versions/12/behavior-changes-12#exported
My AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.c4life.guardianangel">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<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_BACKGROUND_LOCATION"/>
<application
tools:replace="android:label"
android:label="GA"
android:exported="true"
android:icon="#mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="[insert API key here]"/>
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service android:name="changjoopark.com.flutter_foreground_plugin.FlutterForegroundService" android:exported="false"/>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<uses-sdk
android:targetSdkVersion="30"
tools:overrideLibrary="changjoopark.com.flutter_foreground_plugin" />
According to google new policy If your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported: true attribute for these app components.
FOR FLUTTER AND REACT NATIVE PROJECTS :
add this line to AndroidManifest.xml file of project :
android:exported="true"
Now just rebuild your project. In most of the cases this work like a charm.
If above solution is not working or if your project is in Android Native follow the below instructions :
In the main manifest file check all the activities, services, and receivers that can use intent-filter which are without the android: exported tag.
Add android:exported="true" or android:exported="false" for these tags.
You might ask when I need to add android:exported="true" or android:exported="false" to the activities, services, or broadcast receivers that use intent filters. If the app component includes the LAUNCHER category, set android: exported to true otherwise set android: exported to false.
If adding the android: exported in the main manifest file not works for you follow the below steps:
open AndroidManifest.xml file and at the bottom select Merged Manifest.
like this :
if you are not able to preview Merged Manifest then in your build.gradle file
set compileSdkVersion 30 and targetSdkVersion 30 and sync your project and now try to open the merged manifest again I hope this time you will have a proper preview of the merged manifest. but if there is no preview don't worry you can still navigate to individual manifest files from different third-party libraries you have used in your project.
Note: also check individual third-party library manifest files if there is any activity, service, or receiver using then you have to override the same activity, service, or receiver in your main manifest file with android: exported property.
For Example in my case I have defined android: exported for each and every activity, service, or receiver in my main manifest file but in my project, I was using Razorpay dependency so in the manifest of Razorpay I found that there is an activity and receiver which are using property without android: exported so I declared them in my main manifest files.
as shown below :
<activity
android:name="com.razorpay.CheckoutActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:theme="#style/CheckoutTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<data
android:host="rzp.io"
android:scheme="io.rzp" />
</intent-filter>
</activity>
<receiver android:name="com.razorpay.RzpTokenReceiver"
android:exported="true"
android:permission="android.permission.INTERNET">
<intent-filter>
<action android:name="rzp.device_token.share" />
</intent-filter>
</receiver>
Note: in your case, you may have to go through more files and check activity, and services, and mention them in your main manifest file.
also after doing all this you can change back to targetSdkVersion 31 and compileSdkVersion 31 in your build.gradle file.
In my case, I just add this line to my manifest:
android:exported="true"
I finally fixed this issue
1: install emulator with android v 12
2: run your app
the compailer will tell you what service/reciver...etc casued the issue
now you have to add it to your manifist and add the android:exported="true" to it
in my case the prblem was with the local notifcation package
i got the message to fix this receiver
com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver
so i added to my manifist out side the main activity
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
and it worked as intended
By just adding exported:true to your Android manifest activity did not solve my issue. Probably because the libraries your application depends on does not have exported:true You shouldn't encounter this bug in the future as long as the libraries are updated with exported:true
You have to
open project in Android studio
Open Androidmanifest.xml
At the bottom select merged manifest
Now ensure that you add exported to true wherever stated and fix those warnings specified on the line (in blue) and tapping blue text does not take you to one of these tags Services, activity, receiver in above step then look for the library for which the merge error exist
e.g a merge error here shows issue in flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
So go to the manifest of that specific library which is listed in blue above the error, where you can add exported to true.(this will also resolve the merge error)
Add exported to true in services tag
Video demo here: https://www.youtube.com/watch?v=hy0J8MNnE6g
if use targetSdkVersion=31
package="com.name.app"><!-- Channnge your package -->
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
<application
android:label="Tut Elimi"
android:icon="#mipmap/ic_launcher">
<service android:name="com.example.app.backgroundService"
android:exported="true">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</service>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value=""/>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/splash"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<service
android:name="com.name.app.BackgroundService"
android:enabled="true"
android:exported="true" />
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest> ````
The "exported" attribute describes whether or not someone else can be
allowed to use it.
So if you have "exported=false" on an Activity, no other app, or even
the Android system itself, can launch it. Only you can do that, from
inside your own application.
So settings "exported=false" on the Activity marked as the LAUNCHER
Activity would basically tell the system that it cant launch your
application, ever.
If you are not using any other project then update all library latest versions because some old library AndroidManifest.xml not added android: exported in activities, services, or broadcast receivers
If your Android Studio don't show the Merged Manifest tab, you can figure out what is the problem by searching on the merged AndroidManifest.xml file.
To me it was on: \build\app\intermediates\merged_manifests\release\AndroidManifest.xml
And my problem was the ScheduledNotificationBootReceiver:
Add this to your Manifest:
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
android:exported="true">
</receiver>
If you are flutter developer and unable to find Merged Manifest tab, follow th e steps:
Open Project in Android Studio.
Navigate to main AndroidManifest.xml.
Navigation
Wait for Project Loading
Wait for Project
Here it is... Found
The problem on my RN app is that at debug/AndroidManifest.xml the exported for facebook.react.devsupport was set to false. changed that to true solved it.
Pressing merged Manifest showed me where the issue is.
Hope that helps.
Xamarin Forms: I was able to publish it, I had to update the AndroidManifest with the path obj\Release\120\android\manifest since some "receiver" were not there and had not added the "android:exported".
This is for Unity Developers in specific and for any frame work targeting android platform in general. If by any means, you are not able to publish even if you have added android:exported property to every activity/receiver containing intent filter, then you should do this approach and hopefully you will be able to solve the issue.
Problem
Recently, Playstore started to require apps / games to target API 31. You updated SDK, Gradle and all that stuff. You got a build, published to PlayStore and now Playstore is telling you, this
you uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set.
YOU HAVE ALREADY TRIED
You now know that the Android Manifests including in you app / game contains some Activities, receivers, activity-alias etc which contain intent-filter but does not have android:exported property set to true or false.
You tried adding this property to all of the Manifests and unity 's own manifest by Enablisng Custom Android Manifest too. But still Playstore is not accepting the app.
You don't want to update Unity version to fix this. You still have a solution.
Let's Narrows down
You are doing good in adding android:exported property but when you are getting build, not all of those tags persist. During build, unity is replacing you properties, especially properties related to external plugins you have used in your app.
So lets have a look which plugins contain problematic activities/receivers etc.
Instead of building a bundle or apk, Export your unity project as Android Project.
Open project in android studio, and build there.
After build is complete, go to this file which is the Merged Menifest containing data from all individual manifests.
YourExportedProjectFolder\launcher\build\intermediates\merged_manifests\release
Go precisely through this file and check which activities/receivers etc does not contain exported:property set. Not down that plugin. That is the culprit.
Let's fix it
Go back to unity, go to the relevant plugin manifest, copy those specific problematic activities (Complete i.e. along with intent-filters) from that manifest and paste to
Assets/Plugin/Android/AndroidManifest
Something like this
<receiver android:name="universal.tools.notifications.ScheduledNotificationsRestorer"
android:exported="true"
tools:replace="android:exported">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
Now build again and you should be good to go!
for react native that have many library i fix it with this step :
first is you build or run, then you look at app/build/intermedied/merged_manifest/release/AndroidManifest.xml
then look at all that have then copy from open tag above it and the closing tag either it activities, services, or broadcast, receivers. then paste to folder android/app/src/main/AndroidManifest.xml and dont forget to put android:exported="true" to fix it. if you already cover all intent-filter then save then build again.
For Unity i did this, i went to gameProjectFolder\Temp\StagingArea y copy unityManifest to gameProjectFolder\Assets\Plugins\Android and changed the name to
AndroidManifest and in the label activity I add android:exported="true"
Adding the line android:exported="true" to my Manifes
Need to add android:exported="true" to all components which has an intent-filter.
See where you need to add it you can opening Merged Manifest file.
Just change
build.gradle -> defaultConfig
targetSdkVersion="31"
to
targetSdkVersion="30"
work normal for me.
I have added android:exported="true" to my only activity in manifest but still getting below error after updating compile sdk and target sdk version to 31.I also tried rebuilding the project , invalidating cache and restart but that didn't helped
Error- Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
AndroidManifest File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xyz.abc">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".framework.presentation.BaseApplication"
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="com.xyz.presentation.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Merged manifest error
Other Manifest Files (Included in merge, but did not contribute any
elements) firebase-installations:17.0.0 manifest,
versionedparcelable:1.1.1 manifest, runtime:1.0.1 manifest,
test:core:1.2.0 manifest, loader:1.0.0 manifest, facebook-share:11.1.0
manifest, leakcanary:leaksentry:2.0-alpha-3 manifest,
material-dialogs:input:3.2.1 manifest, material-icons-extended:1.0.0
manifest, play-services-stats:17.0.0 manifest, interpolator:1.0.0
manifest, activity-compose:1.3.1 manifest, material-ripple:1.0.0
manifest, foundation:1.0.0 manifest, asynclayoutinflater:1.0.0
manifest, savedstate-ktx:1.1.0 manifest,
navigation-dynamic-features-fragment:2.3.5 manifest,
firebase-ui-auth:7.2.0 manifest, animation:1.0.1 manifest,
animation-core:1.0.1 manifest, installreferrer:1.0 manifest,
firebase-crashlytics:18.0.0 manifest, ui:1.0.1 manifest,
lifecycle-viewmodel-savedstate:2.3.1 manifest,
play-services-auth-base:17.0.0 manifest, hilt-android:2.35.1 manifest,
material-dialogs:core:3.2.1 manifest, AndroidManifest.xml navigation
file, savedstate:1.1.0 manifest, cursoradapter:1.0.0 manifest,
sqlite-framework:2.0.1 manifest, room-ktx:2.1.0 manifest,
leakcanary-android-core:2.0-alpha-3 manifest, AndroidManifest.xml
navigation file, media:1.0.0 manifest, coordinatorlayout:1.1.0
manifest, legacy-support-core-utils:1.0.0 manifest,
lifecycle-runtime:2.3.1 manifest, coil-kt:coil:1.3.1 manifest,
ui-tooling-preview:1.0.0 manifest, facebook-core:11.1.0 manifest,
core:1.6.0 manifest, material:1.0.0 manifest, firebase-common:20.0.0
manifest, documentfile:1.0.0 manifest,
lifecycle-viewmodel-compose:2.4.0-beta01 manifest,
play-services-base:17.1.0 manifest, ui-tooling-data:1.0.0 manifest,
coil-base:1.3.1 manifest, firebase-analytics-ktx:19.0.0 manifest,
localbroadcastmanager:1.0.0 manifest, swiperefreshlayout:1.1.0-alpha03
manifest, constraintlayout-compose:1.0.0-beta02 manifest,
core-ktx:1.6.0 manifest, firebase-database-collection:18.0.0 manifest,
coil-compose-base:1.3.1 manifest, activity:1.3.1 manifest,
AndroidManifest.xml navigation file, facebook-messenger:11.1.0
manifest, print:1.0.0 manifest, customview:1.1.0 manifest,
material-icons-core:1.0.0 manifest,
play-services-measurement-sdk:19.0.0 manifest, fragment:1.3.4
manifest, firebase-appcheck-interop:16.0.0-beta01 manifest,
facebook-login:11.1.0 manifest, cardview:1.0.0 manifest,
runtime-rxjava2:1.0.0 manifest, viewpager2:1.0.0 manifest,
play-services-ads-identifier:17.0.0 manifest,
play-services-measurement-impl:19.0.0 manifest,
lifecycle-livedata-core:2.3.1 manifest, play-services-safetynet:17.0.0
manifest, AndroidManifest.xml navigation file,
lifecycle-viewmodel-ktx:2.3.1 manifest, transport-backend-cct:3.0.0
manifest, fragment-ktx:1.2.4 manifest, appcompat:1.3.0 manifest,
transport-runtime:3.0.0 manifest, lifecycle-livedata-core-ktx:2.2.0
manifest, firebase-firestore-ktx:23.0.0 manifest,
legacy-support-v4:1.0.0 manifest, play-services-basement:17.1.1
manifest, firebase-storage:20.0.0 manifest,
play-services-auth-api-phone:17.4.0 manifest,
leakcanary-android:2.0-alpha-3 manifest, firebase-auth-interop:20.0.0
manifest, lifecycle-viewmodel:2.3.1 manifest, browser:1.0.0 manifest,
firebase-auth:21.0.1 manifest, material:1.2.1 manifest,
slidingpanelayout:1.0.0 manifest, vectordrawable:1.1.0 manifest,
recyclerview:1.1.0 manifest, play-services-auth:19.0.0 manifest,
room-runtime:2.1.0 manifest, dagger-lint-aar:2.35.1 manifest,
navigation-dynamic-features-runtime:2.3.5 manifest,
play-services-measurement-api:19.0.0 manifest,
firebase-encoders-json:18.0.0 manifest, sqlite:2.0.1 manifest,
facebook-android-sdk:11.1.0 manifest, firebase-components:17.0.0
manifest, transport-api:3.0.0 manifest,
protolite-well-known-types:18.0.0 manifest, markdown-processor:0.1.3
manifest, play-services-measurement-base:19.0.0 manifest,
firebase-common-ktx:20.0.0 manifest, activity-ktx:1.3.1 manifest,
firebase-crashlytics-ktx:18.0.0 manifest, coil-compose:1.3.1 manifest,
multidex:2.0.1 manifest, core-runtime:2.1.0 manifest,
fragment-testing:1.2.0 manifest, ui-graphics:1.0.1 manifest,
AndroidManifest.xml navigation file, ui-tooling:1.0.0 manifest,
grpc-android:1.28.0 manifest, ui-unit:1.0.1 manifest,
play-services-measurement:19.0.0 manifest, play:core:1.9.1 manifest,
annotation-experimental:1.1.0 manifest,
play-services-measurement-sdk-api:19.0.0 manifest,
play-services-tasks:17.0.0 manifest, firebase-analytics:19.0.0
manifest, facebook-common:11.1.0 manifest, drawerlayout:1.1.1
manifest, AndroidManifest.xml navigation file,
navigation-compose:2.4.0-alpha09 manifest,
facebook-gamingservices:11.1.0 manifest, firebase-firestore:23.0.0
manifest, lifecycle-livedata:2.2.0 manifest,
legacy-support-core-ui:1.0.0 manifest, test:monitor:1.2.0 manifest,
AndroidManifest.xml navigation file, facebook-applinks:11.1.0
manifest, viewpager:1.0.0 manifest, ui-geometry:1.0.1 manifest,
lifecycle-runtime-ktx:2.3.1 manifest, constraintlayout:2.0.4 manifest,
ui-text:1.0.1 manifest, AndroidManifest.xml navigation file,
firebase-installations-interop:17.0.0 manifest, transition:1.3.0
manifest, foundation-layout:1.0.1 manifest, appcompat-resources:1.3.1
manifest, runtime-livedata:1.0.0 manifest, runtime-saveable:1.0.1
manifest, firebase-measurement-connector:19.0.0 manifest,
vectordrawable-animated:1.1.0 manifest, main nav_graph.xml navigation
file Merging Errors: Error: android:exported needs to be explicitly
specified for . Apps targeting Android 12 and higher are
required to specify an explicit value for android:exported when the
corresponding component has an intent filter defined. See
https://developer.android.com/guide/topics/manifest/activity-element#exported
for details. Dairy.app main manifest (this file) Error:
android:exported needs to be explicitly specified for . Apps
targeting Android 12 and higher are required to specify an explicit
value for android:exported when the corresponding component has an
intent filter defined. See
https://developer.android.com/guide/topics/manifest/activity-element#exported
for details. Dairy.app main manifest (this file) Error:
android:exported needs to be explicitly specified for . Apps
targeting Android 12 and higher are required to specify an explicit
value for android:exported when the corresponding component has an
intent filter defined. See
https://developer.android.com/guide/topics/manifest/activity-element#exported
for details. Dairy.app main manifest (this file)
androidx.test:core library version 1.3.0. Upgrading to version 1.4.0 fixed the issue.
To solve this error in target sdk 31-
1.First of all set target sdk to 30
2.Then go to the merged manifest
3.Find if there’s any activity, service, receiver or provider that does not have android:exported set.Override all those entries and set their android:exported to true or false.
4.set target sdk back to 31 and run project
See also android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify.
Thanks to #faizy, #Android Developer I made this.
Upgrade these libraries to new versions:
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.fragment:fragment-testing:1.4.1"
androidTestImplementation "androidx.test:core:1.4.0"
I replaced debugImplementation with androidTestImplementation in these dependencies.
Press Sync Project with Gradle Files. Run the project (or rebuild, or run Lint). Probably it won't help. Then you should make this.
Downgrade targetSdkVersion to 30.
Run the project again. Probably it will compile.
In my case all needed android:exported="true" and android:exported="false" presented in activity, service, receiver and provider of merged AndroidManifest where <intent-filter> occured.
To find merged AndroidManifest, switch to Project and expand app module, then build > intermediates > merged_manifest > debug.
If some android:exported was missing, find a corresponding AndroidManifest and add it there.
Upgrade targetSdkVersion to 31.
Run the project again. If it won't compile, probably you should rebuild the project. As usually, Build > Rebuild Project, File > Invalidate Caches > Invalidate and Restart.
After some time (several gradle syncs, restarts of Android Studio) it compiled.
The following in app/build.gradle may be the cause.
dependencies {
debugImplementation androidx.fragment:fragment-testing:<1.4.0-alpha02 or lower>’
}
Solution 1
Update fragment-testing to 1.4.0-alpha03 or higher.
Solution 2
Add the following to AndroidManifest.xml.
<manifest>
<application>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:exported="false" />
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="false" />
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="false" />
</application>
</manifest>
if you are using flutter , upgrading flutter_local_notifications to the latest version (now is 9.3.2) solved this error for me..
In my case the problem was with a dependency that strictly uses version 1.0.0 of androidx.test.core, so i can't upgrade it. what i did is to add android:exported="false" to androidx.test.core activity in my main manifest with tools:node="merge" so it can be merged with origin manifest
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="false"
tools:node="merge" >
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="false"
tools:node="merge">
</activity>
and add the tools namespace.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
xmlns:tools="http://schemas.android.com/tools">
I had this problem, I add android:exported="true" and also tools:node="merge" to AndroidManifest.xml but however this error was appeared .
I found this is not about my project's Activates rather is about some dependencies, like this:
implementation 'com.najva.sdk:najva-android-sdk:1.3.3'
so check your project dependencies, you will find it surely.
if you use ogury Ads put this in youre AndroidManifest file
<activity
android:name="io.presage.mraid.browser.ShortcutActivity"
android:theme="#style/Presage.AdScreen"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
android { compileSdk 31
It is important to use latest version of Gradle and Gradle Plugin.
Update your all dependencies to latest version also.
If problem still persists.
Go to your manifest file.
Click merged manifest at the bottom.
Check the error at the bottom right side, which dependency is causing the error.
Go to that particular dependency from above mentioned dependencies.
Set android:exported="true" or android:exported="false" where error was mentioned in merged manifest.
Note: Updating that dependency to the latest version will probably also fix that issue. Because in the latest versions of dependenciesexported properties are already set.
This issue originates from dependencies of project. Right click on intent-filter and select find usages option. Now, in all usage places check that if exported assigned value or nor. If not, assign a value (Even in cache folders for libraries). This will fix issue until cache refresh but you have identifies the libraries creating this problem.
I found the answer,
you should add android:exported="true" to all activities, services and receivers in the AndroidManifest.xml file as following.
<activity
android:name="com.ryanheise.audioservice.AudioServiceActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="true"
android:windowSoftInputMode="adjustResize">
<service android:name="com.ryanheise.audioservice.AudioService"
android:exported="true"
>
and for receiver
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver"
android:exported="true"
Explicitly add the conflicting service to Properties\AndroidManifest.xml file, so that when it is merged in by your plugin it retains the android:exported="true" (or false).
<application>
...
<service android:name="1234.PNFirebaseMessagingService" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
for me the solution was to add this tools:node="merge" behind each android:exported="true" and add xmlns:tools="http://schemas.android.com/tools" property in your manifest balise.
The solution is very simple, all you have to do is make sure that all of these tags are present...
<activity
android:exported="true"/>
<receiver
android:exported="true"/>
<service
android:exported="true"/>
just add android:exported="true" to all dont change any thing
and If you do not have any of the tags, you must add them all
Got the solution for this one for Nativescript project. [Tried and Tested]
Search intent-filter in the build project directory (./platforms)
Check if each intent-filter parent (activity, service, reciever..) have property android:exported="true".
If it does not have android:exported="true" then copy the whole <service/activity/reciever></service/activity/reciever> block
and put it into AndroidMenifest.xml under App_resource folder, update
the tag with android:exported="true" and again build the project.
Should Work Now.
if you are using flutter , upgrading flutter_local_notifications to the latest version (now is 9.3.2) may solve this error..
solve is the problem :
1- targetSdkVersion if 31 change to 30
2- add line in AndroidManifest inside <activity android:exported="true" />