0

正如大多数解决方案在这里所建议的那样,我已经在我的清单文件中添加android:exported="true"了有意图的活动。但是清单合并返回以下错误:

错误:需要明确指定 android:exported 为 . 面向 Android 12 及更高版本的应用需要为android:exported相应组件定义了 Intent 过滤器时指定显式值。

当我编译项目时,出现以下错误;

错误:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED:在 installPackageLI 期间解析失败:/data/app/vmdl1256332459.tmp/base.apk(在二进制 XML 文件第 132 行):org.altbeacon.beacon.startup.StartupBroadcastReceiver:定位 S+(版本 31 及更高版本)需要当存在意图过滤器时定义 android:exported 的显式值'

AndroidManifest.xml 如下:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.xxxxxx.android_sample">

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />

    <uses-feature android:name="android.hardware.camera.ar" />

    <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
        <activity
                android:name=".view.home.MainActivity"
                android:exported="true"
                android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
                android:name=".view.notification_sample.NotificationSampleActivity"
                android:label="@string/title_notification_sample"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.auto_fill_sample.AutoFillSampleActivity"
                android:label="@string/title_auto_fill_sample"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.beacon_android.BeaconAndroidActivity"
                android:label="@string/title_beacon_android"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.beacon_alt.BeaconAltActivity"
                android:label="@string/title_beacon_alt"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.welcome_point.WelcomePointActivity"
                android:label="@string/title_welcome_point"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.stamp_rally.StampRallyActivity"
                android:label="@string/title_stamp_rally"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.sensor_beacon.SensorBeaconActivity"
                android:label="@string/title_sensor_beacon"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.ar.menu.ArMenuActivity"
                android:label="@string/title_ar_menu"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.ar.scene_form.SceneFormActivity"
                android:label="@string/title_scene_form"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.ar.argumented_images.AugmentedImagesActivity"
                android:label="@string/title_scene_form"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.ar.cloud_anchor.CloudAnchorActivity"
                android:label="@string/title_scene_form"
                android:screenOrientation="portrait" />
        <activity
                android:name=".view.splash.SplashActivity"
                android:screenOrientation="portrait"
                android:theme="@style/SplashTheme" />

        <meta-data
                android:name="com.google.ar.core"
                android:value="required" />
        <meta-data
                android:name="com.google.android.ar.API_KEY"
                android:value="xxxxxxxxxx_xxxxxxx_x" />
    </application>

</manifest>

非常感谢有关如何解决此问题的任何帮助,谢谢。

4

1 回答 1

1

您能否将 Android 信标库更新到最新版本(目前基于其发布的版本为 2.19 版),因为从这次提交中我了解到他们已经解决了这个问题。

让我知道这是否有帮助。

于 2021-08-24T05:15:29.297 回答