简体   繁体   中英

android:exported needs to be explicitly specified

I have checked all activities in the manifest.xml file, all activities are present with android:exported="true" but it retainlessly showing this error **Manifest merger failed: android:exported needs to be explicitly specified for element <activity#im.dino.dbinspector.activities.DbInspectorActivity>. 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. ** what should i do now?

my manifest file is

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="shubham.lists.happyplaces">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.HappyPlaces"
        tools:targetApi="31">
        <activity
            android:name=".activities.AddHappyPlaceActivity"
            android:exported="true"
            android:label="ADD HAPPY PLACE"
            android:screenOrientation="fullSensor"
            android:theme="@style/CustomNoActionBarTheme"
            tools:node="merge" />
        <activity
            android:name=".activities.MainActivity"
            android:exported="true"
            tools:node="merge">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

gradle build

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "shubham.lists.happyplaces"
        minSdk 22
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures{
        viewBinding true
    }
}

dependencies {
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.karumi:dexter:6.0.1'
    debugImplementation 'im.dino:dbinspector:3.4.1@aar'

    //androidTestImplementation "androidx.fragment:fragment-testing:<version>"
    //androidTestImplementation 'androidx.test.ext:junit'
    //androidTestImplementation "androidx.test.ext:junit:1.1.3"
    //androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.1.1"
    //implementation 'androidx.core:core-ktx:1.8.0'
    //implementation 'androidx.appcompat:appcompat:1.4.2'
    //implementation 'com.google.android.material:material:1.6.1'
    //implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.google.android.material:material:1.6.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

WAITING FOR AN EARLY RESPONSSE

Try upgrading im.dino:dbinspector . You are on 3.4.1. The latest is 5.4.7. And based on the library's manifest in GitHub , this issue should be fixed.

I have the same issue with the same course from Udemy now, can't fix it, already watched all videos and all topics:

The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide ( https://goo.gle/kotlin-android-extensions-deprecation ) to start working with View Binding ( https://developer.android.com/topic/libraries/view-binding ) and the 'kotlin-parcelize' plugin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM