Im building script that will change some info in gradle flavors dynamic and then build apk Using gradlew assemble' + $UsableProjectName + 'Release

Now my problem is the new flavor i have added is not seen by gradle yet or in the project index files, so i need to click on gradle sync to be able to recognise it and run successful build.

I have tried :

gradlew --recompile-scripts

and

gradlew assemble

But after running both of them i still cant see the new flavor until i do manual sync from the android studio.

Is there away to sync the gradle using command line ?

1 Answers

0
Ranjan Kumar On Best Solutions

It shall work without doing gradle sync. do run command 'gradlew tasks' to see list of 'Build Tasks'; new flavor shall be listed as 'assembleflavor1' or 'assembleflavor2'.