truecaller / flutter-sdk

Flutter plugin that uses Truecaller's Android SDK to provide mobile number verification service to verify users.
https://pub.dev/packages/truecaller_sdk
MIT License
24 stars 43 forks source link

getting missing package key attribute error #15

Closed SatyamKr07 closed 3 years ago

SatyamKr07 commented 3 years ago

this is the detailed error: [com.truecaller.android.sdk:truecaller-sdk:2.6.0] C:\Users\Satyam.gradle\caches\transforms-2\files-2.1\3ff96c229feccd05b9bbe1d54f7ce1af\jetified-truecaller-sdk-2.6.0\AndroidManifest.xml:45:9-50 Error: Missing 'package' key attribute on element package at [com.truecaller.android.sdk:truecaller-sdk:2.6.0] AndroidManifest.xml:45:9-50 [com.truecaller.android.sdk:truecaller-sdk:2.6.0] C:\Users\Satyam.gradle\caches\transforms-2\files-2.1\3ff96c229feccd05b9bbe1d54f7ce1af\jetified-truecaller-sdk-2.6.0\AndroidManifest.xml:46:9-56 Error: Missing 'package' key attribute on element package at [com.truecaller.android.sdk:truecaller-sdk:2.6.0] AndroidManifest.xml:46:9-56 [com.truecaller.android.sdk:truecaller-sdk:2.6.0] C:\Users\Satyam.gradle\caches\transforms-2\files-2.1\3ff96c229feccd05b9bbe1d54f7ce1af\jetified-truecaller-sdk-2.6.0\AndroidManifest.xml Error: Validation failed, exiting

it points out to this-

 <!--
         To resolve package visibility issue on Android 11 & above with targetSdkVersion >=30, <queries> element
         needs to be added with the package name
    -->
    <queries>
         <package android:name="com.truecaller" />
        <package android:name="com.truecaller.debug" />
    </queries> 

flutter doctor: Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19042.804], locale en-IN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 3.6) [√] VS Code (version 1.53.2) [√] Connected device (1 available)

i have followed the required code changes that needs to be done according to the official documentation. Help please

parth0907 commented 3 years ago

Hi Satyam,

It seems like you are using an older version of AGP(android gradle plugin). The issue that you are facing is because the older versions of AGP are not aware of this new element.

You can find the documentation by Google on this, here - https://android-developers.googleblog.com/2020/07/preparing-your-build-for-package-visibility-in-android-11.html

I would request you to try out this approach and let us know if it works. For further queries please feel free to reach us via our support channel https://developer.truecaller.com/support for a faster and dedicated response.

Hope this helps!

Regards, Parth

SatyamKr07 commented 3 years ago

Thanks! It solved the issue.