How to Fix the 'android:exported' Error When Uploading an APK or Android App Bundle
If you are an Android developer, you might have encountered this error message when uploading your app to Google Play:
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.
This error means that your app bundle does not comply with the new requirements for Android 12 or higher, which mandate that all app components that can be launched by other apps must explicitly declare their exported status using the 'android:exported' property in the manifest file.
you uploaded an apk or android app bundle which has an activity activity alias service
In this article, we will explain what an APK or Android App Bundle is, what an activity, activity alias, service or broadcast receiver with intent filter is, what the 'android:exported' property is and why it is required, how to set it for your app components, and how to check if your app bundle meets the compressed download size restriction.
What is an APK or Android App Bundle?
An APK (Android Package) is the executable file format for Android apps. It contains all the compiled code and resources of your app, as well as a manifest file that provides information about your app to the Android system and a set of certificates and signing keys that verify your identity as the publisher.
An Android App Bundle is a new publishing format that Google introduced in 2018 to address some of the shortcomings of APKs. It includes all your app's compiled code and resources, but defers APK generation and signing to Google Play. Google Play uses your app bundle to generate and serve optimized APKs for each device configuration, so only the code and resources that are needed for a specific device are downloaded to run your app. You no longer have to build, sign, and manage multiple APKs to support different devices, and users get smaller, more-optimized downloads.
How to fix android:exported property error in APK or Android App Bundle
Android 12 behavior changes and android:exported attribute for app components
You uploaded an APK or Android App Bundle with intent filter but without android:exported set
AndroidManifest.xml file and android:exported property for activity, activity alias, service or broadcast receiver
Google Play Console error: You uploaded an APK or Android App Bundle which has an activity activity alias service without android:exported
What is android:exported and why is it required for APK or Android App Bundle upload
How to set android:exported to true or false for app components with intent filter
You uploaded an APK or Android App Bundle which has an activity activity alias service that can't be installed on Android 12 or higher
How to declare android:exported for app components that use intent filters in Android 12
You uploaded an APK or Android App Bundle which has an activity activity alias service with missing android:exported property
How to avoid android:exported error when uploading APK or Android App Bundle to Google Play Console
Android 12 compatibility and android:exported attribute for app components with intent filter
You uploaded an APK or Android App Bundle which has an activity activity alias service without specifying android:exported
How to add android:exported to app components in AndroidManifest.xml file
Google Play Console warning: You uploaded an APK or Android App Bundle which has an activity activity alias service without 'android:exported' set
What does android:exported mean and how to use it for app components with intent filter
How to set android:exported correctly for activity, activity alias, service or broadcast receiver in APK or Android App Bundle
You uploaded an APK or Android App Bundle which has an activity activity alias service that is not compatible with Android 12 or higher
How to update android:exported for app components that use intent filters in Android 12
You uploaded an APK or Android App Bundle which has an activity activity alias service with undefined android:exported property
How to fix Google Play Console error about android:exported when uploading APK or Android App Bundle
Android 12 behavior changes and how they affect android:exported attribute for app components with intent filter
You uploaded an APK or Android App Bundle which has an activity activity alias service without 'android:exported' attribute set
How to edit AndroidManifest.xml file and add android:exported to app components with intent filter
Google Play Console issue: You uploaded an APK or Android App Bundle which has an activity activity alias service without 'android:exported' property set
What is the purpose of android:exported and how to apply it for app components with intent filter
How to determine the value of android:exported for activity, activity alias, service or broadcast receiver in APK or Android App Bundle
You uploaded an APK or Android App Bundle which has an activity activity alias service that does not support Android 12 or higher
How to change android:exported for app components that use intent filters in Android 12
You uploaded an APK or Android App Bundle which has an activity activity alias service with omitted android:exported property
What is an activity, activity alias, service or broadcast receiver with intent filter?
An activity is a component of your app that provides a user interface for a specific task. For example, an activity might display a list of contacts, a map, or a game screen.
An activity alias is a component that acts as an alternative name for an existing activity. It allows you to present the same activity as a different entity with its own set of intent filters. For example, you might use an activity alias to create a launcher icon for a specific mode of your app.
A service is a component of your app that runs in the background without a user interface. It can perform long-running operations or work for remote processes. For example, a service might play music, download files, or sync data.
send a notification when a new message arrives.
An intent filter is a set of conditions that specifies the types of intents that a component can receive. It declares the actions, data, and categories that the component can handle. For example, an intent filter might specify that an activity can view web pages, a service can play music files, or a broadcast receiver can listen to network changes.
What is the 'android:exported' property and why is it required?
The 'android:exported' property is an attribute that you can set for your app components in the manifest file. It indicates whether the component can be launched by components of other apps. If the 'android:exported' property is set to true, it means that the component is available to other apps. If it is set to false, it means that the component is private to your app and cannot be accessed by other apps.
The 'android:exported' property is required for Android 12 or higher because of the new security and privacy enhancements that Google introduced in this version. One of these enhancements is the PendingIntent mutability flag, which allows you to control how other apps can modify the intents that you create and pass to them. Another enhancement is the foreground service launch restriction, which prevents apps from starting foreground services from the background without user awareness or consent. These enhancements require that you explicitly declare the exported status of your app components that can be launched by other apps, so that the system can enforce the appropriate permissions and restrictions.
How to set the 'android:exported' property for your app components?
You can set the 'android:exported' property for your app components in two ways: using Android Studio or using a text editor.
Using Android Studio
If you are using Android Studio as your IDE, you can easily set the 'android:exported' property for your app components using the Manifest editor. To do this, follow these steps:
Open your app's manifest file (AndroidManifest.xml) in Android Studio.
Select the Merged Manifest tab at the bottom of the editor.
Expand the Components section and find the component that you want to set the 'android:exported' property for.
Click on the Attributes button next to the component name.
In the Attributes dialog, find the 'android:exported' attribute and check or uncheck the box to set it to true or false.
Click OK to save your changes.
Using a text editor
If you prefer to use a text editor to edit your app's manifest file, you can also set the 'android:exported' property for your app components manually. To do this, follow these steps:
Open your app's manifest file (AndroidManifest.xml) in a text editor of your choice.
Find the element that corresponds to the component that you want to set the 'android:exported' property for. It can be an , , , or element.
Add or modify the 'android:exported' attribute within the element and set its value to either "true" or "false". For example:
<activity android:name=".MainActivity" android:exported="true"> ... How to check if your app bundle meets the compressed download size restriction?
One of the benefits of using an Android App Bundle is that it reduces the size of your app downloads by generating and serving optimized APKs for each device configuration. However, there is still a limit on how large your app bundle can be. The compressed download size of your app bundle must not exceed 150 MB. This is the size of the ZIP file that contains all the files in your app bundle, not the size of the app bundle itself.
To check if your app bundle meets this restriction, you can use the bundletool command-line tool that Google provides. This tool allows you to build, analyze, and test app bundles locally. To use it, follow these steps:
Download the latest version of bundletool from .
Run the following command in a terminal window to generate a ZIP file from your app bundle:
java -jar bundletool-all-1.8.0.jar build-apks --bundle=/path/to/your/app.aab --output=/path/to/your/app.zip
Check the size of the ZIP file that was created. If it is less than 150 MB, your app bundle meets the restriction. If it is more than 150 MB, you need to reduce the size of your app bundle by removing unused code and resources, optimizing images and videos, using dynamic feature modules, or applying other techniques.
Conclusion
In this article, we have explained how to fix the 'android:exported' error when uploading an APK or Android App Bundle to Google Play. We have covered what an APK or Android App Bundle is, what an activity, activity alias, service or broadcast receiver with intent filter is, what the 'android:exported' property is and why it is required, how to set it for your app components, and how to check if your app bundle meets the compressed download size restriction. We hope that this article has helped you to understand and resolve this issue and to publish your app successfully.
FAQs
What is the difference between an APK and an Android App Bundle?
An APK is the executable file format for Android apps. It contains all the compiled code and resources of your app. An Android App Bundle is a new publishing format that defers APK generation and signing to Google Play. Google Play uses your app bundle to generate and serve optimized APKs for each device configuration.
What are the benefits of using an Android App Bundle?
An Android App Bundle reduces the size of your app downloads by generating and serving optimized APKs for each device configuration. It also simplifies your development process by eliminating the need to build, sign, and manage multiple APKs to support different devices.
How do I create an Android App Bundle?
You can create an Android App Bundle using Android Studio or using a Gradle command. To create an Android App Bundle using Android Studio, follow these steps:
Select Build > Generate Signed Bundle / APK from the menu bar.
In the dialog that appears, select Android App Bundle and click Next.
Follow the instructions to create a new or choose an existing key store.
Select a destination folder for your app bundle and click Finish.
To create an Android App Bundle using a Gradle command, follow these steps:
Open a terminal window and navigate to the root directory of your project.
Run the following command:
./gradlew bundleRelease
How do I test my Android App Bundle?
You can test your Android App Bundle using the bundletool command-line tool or using internal app sharing on Google Play. To test your Android App Bundle using bundletool, follow these steps:
Download the latest version of bundletool from .
Run the following command in a terminal window to generate a set of APKs from your app bundle:
java -jar bundletool-all-1.8.0.jar build-apks --bundle=/path/to/your/app.aab --output=/path/to/your/app.apks
Run the following command in a terminal window to install the APKs on a connected device or emulator:
java -jar bundletool-all-1.8.0.jar install-apks --apks=/path/to/your/app.apks
Launch your app and test its functionality and appearance.
To test your Android App Bundle using internal app sharing on Google Play, follow these steps:
Go to the internal app sharing page on the Play Console and turn on internal app sharing.
Upload your app bundle to the internal app sharing page.
Copy the link that is generated and share it with your testers.
Open the link on a device that has the Play Store installed and download your app.
Launch your app and test its functionality and appearance.
How do I upload my Android App Bundle to Google Play?
To upload your Android App Bundle to Google Play, follow these steps:
Go to the App releases page on the Play Console and select the track that you want to upload your app bundle to (such as internal test, closed test, open test, or production).
Click Create new release.
Review the release notes and click Continue.
Click Browse files and select your app bundle file (with .aab extension).
Review and accept the terms of service and click Save.
Review the pre-launch report and fix any issues that are detected.
Click Review release and check the details of your release.
Click Start rollout to publish your app bundle to Google Play.
44f88ac181
Comments