# Child build.gradle not evaluating at afterEvaluate event

**URL:** <https://discuss.gradle.org/t/child-build-gradle-not-evaluating-at-afterevaluate-event/24253>\
**Category:** Help/Discuss\
**Created:** [September 29, 2017, 12:07am UTC](https://discuss.gradle.org/t/child-build-gradle-not-evaluating-at-afterevaluate-event/24253 "2017-09-29T00:07:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scphantm](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/scphantm/32/5691_2.png) [@scphantm](https://discuss.gradle.org/u/scphantm)\
**Post date:** [September 29, 2017, 12:07am UTC](https://discuss.gradle.org/t/child-build-gradle-not-evaluating-at-afterevaluate-event/24253/1 "2017-09-29T00:07:29Z")

</div>

I have a project with 21 subprojects. one of those subprojects has its own build.gradle file because its a little obscure.

Now, i have a configuration setting in the build that is needed during the config phase. So, in my plugin i have

```
project.afterEvaluate {
  if (project == project.rootProject) {
        project.allprojects.each { proj ->
    MetaExtension config = proj.getExtensions().getByType(MetaExtension)
      if (config.inventoryHash == null){
        throw new ProjectHashNotSetException(proj.name)
      }
    }
  }
}

```

Now, if i have everything in one build.gradle file, it all works perfectly. but, as soon as i broke the 21st subproject into its own build.gradle file, it now always comes back as null. copy and past back into one build.gradle file, works fine, 2 gradle files, fails.

Why would this be?
