【问题标题】:Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.instabug.bug [closed]清单合并失败:需要为元素 <activity#com.instabug.bug 显式指定 android:exported [关闭]
【发布时间】:2022-07-27 12:40:12
【问题描述】:

合并错误:错误:需要为元素 显式指定 android:exported。当相应组件定义了 Intent 过滤器时,面向 Android 12 及更高版本的应用需要为 android:exported 指定显式值。详情见https://developer.android.com/guide/topics/manifest/activity-element#exported

【问题讨论】:

  • 欢迎来到 StackOverFlow,这不是提问的合适格式。请提供更多背景,您正在尝试做什么,向我们展示一些代码,您遇到什么错误以及在哪里。基本上,从我在这里阅读的内容来看,您的 Activity 标记中缺少一个 android:exported 标记

标签: android android-studio


【解决方案1】:

在您的清单文件 (AndroidManifest.xml) 中,在 ReportingContainerActivity 的活动标签中添加 android:exported="true"。

【讨论】:

    【解决方案2】:

    看看我的manifest还是同样的问题

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        package="d2si.apps.planetepicking">
    
        <!-- Permissions -->
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    
    
    
    
    
        <permission
            android:name="d2si.apps.planetepicking.permission.SCANNER_RESULT_RECEIVER"
            android:protectionLevel="normal" />
    
        <uses-permission android:name="d2si.apps.planetepicking.permission.SCANNER_RESULT_RECEIVER" />
        <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    
        <uses-feature
            android:name="android.hardware.camera"
            android:required="true" />
    
        <application
            android:name=".App"
            android:persistent="true"
    
            android:allowBackup="true"
            android:icon="@mipmap/ic_roundicon"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_roundicon"
            android:supportsRtl="true"
            android:theme="@style/AppTheme"
            tools:node="merge">
    
    
    
    
            <activity android:name=".interfaceuser.MainActivity"
                android:theme="@style/AppTheme3"
                android:screenOrientation="fullSensor"
                android:exported="true"
                >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.ConfigActivity"
                android:theme="@style/AppTheme3"
                android:screenOrientation="fullSensor"
                android:exported="true"
                tools:node="merge"
                >
                <intent-filter>
                    <action android:name="android.intent.action.CF" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.CommandeActivity"
                android:screenOrientation="fullSensor"
                android:exported="true"
                tools:node="merge">
                <intent-filter>
                    <action android:name="android.intent.action.CMD" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.Configuration"
                android:screenOrientation="fullSensor"
                android:theme="@style/AppTheme3"
                android:exported="true"
                tools:node="merge">
                <intent-filter>
                    <action android:name="android.intent.action.CNF" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.LoginActivity"
                android:screenOrientation="fullSensor"
                android:theme="@style/AppTheme3"
                android:exported="true"
                tools:node="merge">
                <intent-filter>
                    <action android:name="android.intent.action.LG" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.AccueilActivity"
                android:screenOrientation="fullSensor"
                android:exported="true"
                tools:node="merge">
                <intent-filter>
                    <action android:name="android.intent.action.ACC" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.PreparationActivity"
                android:screenOrientation="fullSensor"
                android:theme="@style/AppTheme3"
    
    
                android:windowSoftInputMode="stateHidden|adjustPan"
    
                android:exported="true"
                tools:node="merge">
                <intent-filter>
                    <action android:name="android.intent.action.PREP" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.LAUNCHER" />
    
                </intent-filter>
                <intent-filter>
                    <action android:name="device.scanner.EVENT"/>
                    <category android:name="android.intent.category.DEFAULT"/>
    
                    <data android:mimeType="text/plain"/>
                </intent-filter>
    
            </activity>
    
    
    
    
    
            <activity
                android:name=".interfaceuser.DisplayActivity"
                android:screenOrientation="fullSensor"
                android:exported="true"
                tools:node="merge">
    
                <intent-filter>
                    <action android:name="android.intent.action.VIEW" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name=".interfaceuser.Demarrer_PrepActivity"
                android:screenOrientation="fullSensor"
                android:exported="true"
                tools:node="merge">
                <intent-filter>
                    <action android:name="android.intent.action.DEM" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    
    
    
        </application>
    
    </manifest>

    【讨论】:

      猜你喜欢
      • 2021-11-28
      • 2022-08-12
      • 2021-11-10
      • 1970-01-01
      • 2022-09-29
      • 2021-11-03
      • 2022-07-13
      • 2021-10-03
      • 1970-01-01
      相关资源
      最近更新 更多