Skip to content

Build / sharing does not work targeting Android 31+ #40

@creativecreatorormaybenot

Description

When following the Android installation guide and running on a Pixel 6, the following installation error is thrown:

adb: failed to install app.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during
installPackageLI: /data/app/vmdl1231205057.tmp/base.apk (at Binary XML file line #68): com.snapchat.kit.sdk.SnapKitActivity: Targeting S+ (version 31 and above) requires that an explicit value for
android:exported be defined when intent filters are present]

After adding android:exported="false" to the activity, the following error is thrown during runtime:

Unhandled Exception: PlatformException(error, fun.gatch.story_sharing_example: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

Workaround

A workaround I was able to use was downgarding the targetSdkVersion to 30 in app/build.gradle:

...
        minSdkVersion 21
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions