androidandroid-studioandroid-studio-arctic-fox

Android Studio Rebuilding Project Task :app:processDebugMainManifest FAILED


I recently updated my projects build.gradle to target Android SDK 32 with the statements:
compileSdkVersion 32
targetSdkVersion 32

After this process, I am now unable to Rebuild my project and have it run on my mobile device.
The manifest merger process gives this error:

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.


Execution failed for task ':app:processDebugMainManifest'.


Despite adding the ` android:exported="false" ` property to each activity in my manifest the project is still failing to rebuild.
I tried to comment out all the activities in the manifest and to only leave the LauncherActivity but to my surprise the same error keeps popping up.

If anyone has come across this problem after updating to Android 12 SDK please help out!!
Running Android Studio Arctic Fox 2020.3.1 Patch 4

**EDIT 1**
Tried out solutions and suggested comments on [this S/O thread][1]

Solution

  • After upgrading my Android Studio to Bumblebee, I was able to get a much more descriptive error message that pointed out the missing attributes for the services and activities.

    To my surprise, the Activities and Service were from a USSD automation library we use called Hover. I've had to override these and declare them manually in our Manifest to add the missing android:exported attribute. These are the affected Hover components in the error message:

    <service#com.hover.sdk.requests.HoverAccessibilityService>
    <activity#com.hover.sdk.api.SessionActivity>
    <activity#com.hover.sdk.permissions.PermissionActivity>
    

    These have to be implicitly defined in your Manifest.