Admob for differnet apps using Product flavor

Viewed 74

I have multiple app with same code base. So I Implemented product flavor to achieve it.

Google ads not showing when I change applicationId in product flavor but it's wokring for applicationIdSuffix

    flavorDimensions "prod"
    productFlavors {
        generalKnowledge {
            applicationId "droidudes.general.knowledge.quiz"
            ///applicationIdSuffix '.general'
            dimension "prod"
        }
        physicsQuiz {
            applicationId "droidudes.physics.mcq.trivia.quiz"
            ///applicationIdSuffix '.physics'
            dimension "prod"
        }
    }

Code is pushed at github Repo

2 Answers

In your adMob account, you have to create package including applicationIdSuffix

namely

com.app.id.general

and

com.app.id.physics

I simply clean my project twice then Rebuild it

Afterwards I try cache invalidate and restart.

Doing this kind of stuff along with assembleDebug from Gradle option resolve my issue.

This issue may be due to android studio build or gradle.

Related