Building an App’s Flavor is way damn easy in the Android Studio but in AIDE… 😵
Its not that easy to understand if you are a beginner!
I was, untill yesterday 😛
Its not toooo complicated, just follow the instructions.
I am guessing that you already have a project loaded in AIDE, then click on ‘Add to Project’ > ‘Add a Flavor’ > Your Flavor Name > Ok!
Now navigate to your App level ‘build.gradle’ & specify a different “applicationId” to your flavor.
Okay, so now check your Build Variants by clicking on Menu > Project > Build Variants…
You should see 6 Variants!
The first part Successfull! Now choose your Flavor that you just created > Ok > Build…
So now when you Install & Start the App, there may be a chance that it will Crash! or may even open up nicely but won’t let you navigate through other Activities…!
Why did this happen?
So, if you check the Logcat then you’ll see something like this –
Have you declared the Activity in AndroidManifest?
But then you check the Manifest & all the Activities are Declared…
The Issue here is that if you declare your Activities without adding the package name at prefix, it will crash on your Flavor Build…
For example: This is your original app package name: com.example.app
& this is your flavored package name:
If you have declared your Activities like below in your Manifest –
then Change it to –
These Changes are made only to the main module of the App i.e. Original App & not Flavored…
In this way, change all your activity names in Manifest.
The Reason why does this happen –
When you specify Activities without package name in prefix (.MainActivity) instead of full activity path (com.example.app.MainActivity),
AIDE overrides the
in your Flavored App’s Manifest…
so your Activity is renamed to
which doesn’t exist & you get a Crash!
Hopefully, I encountered this last night & thought of writing it here as it may be helpfull for someone 😊