• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Error in Example

Hello

I am a newbie.

In the example (https://www.tutorialspoint.com/android/android_webview_layout.htm), I am getting the following error:

Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.example.webview_tutorialspoint_9thjan2023.MainActivity>. 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.

Any ideas what to do?

Thanks.
 
I am getting this error while building the project in Android Studio
 

Attachments

  • AndroidError-Javatpoint-9thJan2023.PNG
    AndroidError-Javatpoint-9thJan2023.PNG
    158 KB · Views: 69
you are trying to build an app that has a MainActivity with an intent filter defined, but you have not specified a value for the android:exported attribute in the <activity> element of the app's manifest.

Starting with Android 12, you are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. The value of this attribute determines whether or not the activity can be launched by other apps.

To fix the error, you need to add the android:exported attribute to the <activity> element in the manifest and set its value to either true or false, depending on whether or not you want the activity to be launchable from other apps.

For example:

Code:
<activity
    android:name=".MainActivity"
    android:exported="true"
    ... >
    <intent-filter>
        ...
    </intent-filter>
</activity>
 
Back
Top Bottom