Why do I get Cannot resolve symbol 'CONTENT_PROVIDER_AUTHORITY'?

418 views Asked by At

Why do I get `Cannot resolve symbol 'CONTENT_PROVIDER_AUTHORITY' if I have set this on my build grade:

def contentProviderAuthority = applicationId + ".provider.StickerContentProvider"
        manifestPlaceholders =
                [contentProviderAuthority: contentProviderAuthority]
        // Adds a new field for the authority to the BuildConfig class.
        buildConfigField("String", "CONTENT_PROVIDER_AUTHORITY", "\"${contentProviderAuthority}\"")

And this on the manifest file:

<provider
            android:name=".provider.StickerContentProvider"
            android:authorities="${contentProviderAuthority}"
            android:enabled="true"
            android:exported="true"
            android:readPermission="com.whatsapp.sticker.READ" />

Thanks! <3

1

There are 1 answers

0
Muhammad Mubashar Hussain On

Go in the build.gradle file and paste in android

aaptOptions {
        noCompress "webp"
    } 

and after this paste this in defaultconfig

def contentProviderAuthority = applicationId + ".StickerContentProvider"
        // Creates a placeholder property to use in the manifest.
        manifestPlaceholders =
                [contentProviderAuthority: contentProviderAuthority]
        // Adds a new field for the authority to the BuildConfig class.
        buildConfigField("String",
                "CONTENT_PROVIDER_AUTHORITY",
                "\"${contentProviderAuthority}\"")