Dynamic Project Version with Android Build

I am writing a quick gradle scripts to do releases, existing gradle plugin related to this does not do what I want.

I am mostly able to get it to work however I am not able get android studio project to compile, it complains about missing classes from the sub projects. If I was to run the gradle compile right after the failure it works just fine. This lead me to assume there is some issue with me messing with project versions within the build.

The thing is there are multiple java sub projects within the build and they have dependencies with each other. These java sub project was able to build compile and jar correctly with no issue, its only the android sub project that cannot see the rest of the java sub project.

The question is how the android build treat its dependencies project different than the rest of the regular java project. Is there anyway to force the android gradle build to change its dependencies to the new version for the sub projects?

Thanks