小编MH-*_*ani的帖子

对我来说,添加 android:exported="true" 并不能解决问题

看到这个问题从主屏幕快捷方式启动时,应用程序未安装错误

AndroidManifest.xml:

<application
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/Theme.AppTheme">
        <activity
                android:name=".ui.activity.MainActivity"
                android:screenOrientation="fullSensor"
                android:label="@string/app_name"
                android:exported="true"
                android:configChanges="orientation|screenSize">
            <intent-filter
                    >
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter
                    >
                <action android:name="android.intent.action.VIEW"/>
                <data android:scheme="app" android:host="appname"
                />
                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <nav-graph android:value="@navigation/nav_graph_main"
                    />
        </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

摇篮[应用程序]:

defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 19
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

> Task :app:processDebugMainManifest FAILED
/home/mhrohani/IdeaProjects/PrjName/app/src/main/AndroidManifest.xml Error:
    android:exported needs to be explicitly specified for <receiver>. Apps targeting Android 12 and higher are …
Run Code Online (Sandbox Code Playgroud)

android manifest gradle kotlin android-studio

6
推荐指数
1
解决办法
5964
查看次数

标签 统计

android ×1

android-studio ×1

gradle ×1

kotlin ×1

manifest ×1