0

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

显现

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.will_dev.vpn_app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="com.android.vending.BILLING" />

<application
    android:name="com.will_dev.vpn_app.YouApplication"
    android:hardwareAccelerated="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:roundIcon="@drawable/logo"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name="com.will_dev.vpn_app.view.MainActivity"
         />
    <activity
        android:name="com.will_dev.vpn_app.view.IntroActivity"
         />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.Login"
       />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.TDView"
         />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.EnterReferenceCode"
        />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.RewardPointClaim"
        />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.Verification"
         />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.Spinner"
         />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.AboutUs"
         />

    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.ContactUs"
         />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.PrivacyPolice"
         />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.Faq"
       />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.EarnPoint"
      />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.ForgetPassword"
        />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.Register"
       />
    <activity
        android:name="com.will_dev.vpn_app.fromanother.activity.SplashScreen"
         />
    <activity
        android:name="com.will_dev.vpn_app.view.Servers"
        />
    <activity
        android:exported="true"
        android:name="com.will_dev.vpn_app.fromanother.activity.WelcomeActivity"
        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name="de.blinkt.openvpn.DisconnectVPNActivity"
        android:excludeFromRecents="true"

        android:noHistory="true"
        android:taskAffinity=".DisconnectVPN"
        android:theme="@style/blinkt.dialog" />

    <service
        android:name="de.blinkt.openvpn.core.OpenVPNService"
        android:exported="true"
        android:permission="android.permission.BIND_VPN_SERVICE">
        <intent-filter>
            <action android:name="android.net.VpnService" />
        </intent-filter>
    </service>
    <activity
        android:name="com.will_dev.vpn_app.view.PurchaseActivity"
         />

    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="@string/admob_app_id" />

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id" />

    <activity
        android:name="com.facebook.FacebookActivity"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:exported="true"
        android:label="@string/app_name" />
    <activity
        android:name="com.facebook.CustomTabActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="@string/fb_login_protocol_scheme" />
        </intent-filter>
    </activity>

</application>

我已将exported=true 添加到启动器活动中,但仍然失败

4

2 回答 2

0

如果您的目标是 android 12,请尝试添加 android:exported 到您的所有活动。即使您不想导出它添加 android:export = "false"。

于 2021-09-17T17:57:25.523 回答
0

此问题可能与外部库有关。只需等待库何时更新或从项目中删除这些库。或者您可以尝试在项目中搜索并查找使用意图的库。并使用清单合并属性添加导出到外部库。 https://android-doc.github.io/tools/building/manifest-merge.html

于 2021-09-18T06:46:36.700 回答