Search code examples
flutterdartpayment

"Missing 'package' key attribute on element package at AndroidManifest.xml:11:5-64"


Actually I published a app in play store, in the next update I want to add UPI payments in the app. So, I am using upi_pay package. When I installing the package getting error as "Missing 'package' key attribute on element package at AndroidManifest.xml:11:5-64". Can someone help me in this ? Thanks in advance.


Solution

  • This issue happens for the combination of:

    • Using Android-SDK's API level 31 (or later),
    • With old Gradle version(s).

    Basically, updating build-tools to 31 is not enough to support queries element (of manifest, added since Android 11+). Gradle needs to be updated, too.

    It worked for me when I upgraded Gradle from 3.5.0 to 3.5.4.

    In root build.gradle file, like:

    // ...
    
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
    
    // ...