-1

I get the above error (in the Title) when i run my app, please advise; This happened so after updating gradles.. ERROR: AAPT: error: 'TODO' is incompatible with attribute exported (attr) boolean.

 <?xml version="1.0" encoding="utf-8"?>
        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="com.example.recyclerview"
            android:versionCode="1"
            android:versionName="1.0" >
        
            <uses-sdk
                android:minSdkVersion="19"
                android:targetSdkVersion="31" />
        
            <application
                android:allowBackup="true"
                android:appComponentFactory="androidx.core.app.CoreComponentFactory"
                android:debuggable="true"
                android:icon="@mipmap/ic_launcher"
                android:label="@string/app_name"
                android:roundIcon="@mipmap/ic_launcher_round"
                android:supportsRtl="true"
                android:testOnly="true"
                android:theme="@style/AppTheme" >
                <activity
                    android:name="com.example.recyclerview.MainActivity"
                    android:exported="TODO" >
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN" />
        
                        <category
                            android:name="android.intent.category.LAUNCHER"
                            android:set="true" />
                    </intent-filter>
                </activity>
            </application>
        </manifest>
Junta
  • 97
  • 2
  • 7

1 Answers1

0

You should set a value for the activity's android:exported, as it is now still 'TODO' (literally something you should do).

See the documentation:

This element sets whether the activity can be launched by components of other applications:

  • If "true", the activity is accessible to any app, and is launchable by its exact class name.
  • If "false", the activity can be launched only by components of the same application, applications with the same user ID, or privileged system components. This is the default value when there are no intent filters.

If an activity in your app includes intent filters, set this element to "true" to allow other apps to start it. For example, if the activity is the main activity of the app and includes the category "android.intent.category.LAUNCHER".

If this element is set to "false" and an app tries to start the activity, the system throws an ActivityNotFoundException.

This attribute is not the only way to limit an activity's exposure to other applications. Permissions can also be used to limit the external entities that can invoke the activity (see the permission attribute).

Wouter
  • 534
  • 3
  • 14
  • 22