Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

targetSdkVersion=31时,不能打包 #46

Open
zhongchao opened this issue May 9, 2022 · 0 comments
Open

targetSdkVersion=31时,不能打包 #46

zhongchao opened this issue May 9, 2022 · 0 comments

Comments

@zhongchao
Copy link

当使用targetSdkVersion = 31 编译时提示错误信息“Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

经过检查清单文件发现,部分带有intent-filter的receiver和service没有添加android:exported,如下:
`

        <intent-filter>

            <action
                android:name="com.huawei.intent.action.PUSH_DELAY_NOTIFY" />

            <action
                android:name="com.huawei.intent.action.PUSH" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.huawei.hms.support.api.push.PushReceiver"
        android:permission="com.cscec.odin.smartodin.permission.PROCESS_PUSH_MSG"
        android:directBootAware="true">

        <intent-filter>

            <action
                android:name="com.huawei.android.push.intent.REGISTRATION" />

            <action
                android:name="com.huawei.android.push.intent.RECEIVE" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.igexin.sdk.PushReceiver">

        <intent-filter>

            <action
                android:name="android.intent.action.BOOT_COMPLETED" />

            <action
                android:name="android.net.conn.CONNECTIVITY_CHANGE" />

            <action
                android:name="android.intent.action.USER_PRESENT" />

            <action
                android:name="android.intent.action.MEDIA_MOUNTED" />

            <action
                android:name="android.intent.action.ACTION_POWER_CONNECTED" />

            <action
                android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.meizu.cloud.pushsdk.SystemReceiver"
        android:process=":pushservice">

        <intent-filter>

            <action
                android:name="com.meizu.cloud.pushservice.action.PUSH_SERVICE_START" />

            <category
                android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.igexin.sdk.FlymePushReceiver"
        android:process=":pushservice">

        <intent-filter>

            <action
                android:name="com.meizu.flyme.push.intent.MESSAGE" />

            <action
                android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" />

            <action
                android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" />

            <action
                android:name="com.meizu.c2dm.intent.REGISTRATION" />

            <action
                android:name="com.meizu.c2dm.intent.RECEIVE" />

            <category
                android:name="com.cscec.odin.smartodin" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.igexin.sdk.OppoPushService"
        android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE"
        android:process=":pushservice">

        <intent-filter>

            <action
                android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE" />
        </intent-filter>
    </service>

    <service
        android:name="com.igexin.sdk.OppoAppPushService"
        android:permission="com.heytap.mcs.permission.SEND_PUSH_MESSAGE"
        android:process=":pushservice">

        <intent-filter>

            <action
                android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE" />

            <action
                android:name="com.heytap.msp.push.RECEIVE_MCS_MESSAGE" />
        </intent-filter>
    </service>

    <receiver
        android:name="com.igexin.sdk.VivoPushMessageReceiver"
        android:process=":pushservice">

        <intent-filter>

            <action
                android:name="com.vivo.pushclient.action.RECEIVE" />
        </intent-filter>
    </receiver>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant