【发布时间】:2022-09-23 11:29:02
【问题描述】:
我检查了 manifest.xml 文件中的所有活动,所有活动都存在于 android:exported=\"true\" 但它一直显示此错误 **Manifest merge failed : android:exported 需要为元素显式指定 <activity #im.dino.dbinspector.activities.DbInspectorActivity>。当相应组件定义了 Intent 过滤器时,面向 Android 12 及更高版本的应用需要为 android:exported 指定显式值。有关详细信息,请参阅https://developer.android.com/guide/topics/manifest/activity-element#exported。
**
我现在该怎么办?
我的清单文件是
<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>
梯度构建
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\'
}
等待早期响应
-
DbInspectorActivity在您的项目中吗?.. 如果不是在某些库中