ApolloGraphql FileNotFoundException: source/apollo/generatedIR/debug/src (Is a directory)

最后都变了- 提交于 2019-12-06 11:22:45

There are two solutions which I came accross while researching this problem:

  1. Remove apollo from your project, (by editing your gradle files) clean your project, and add apollo again.

  2. Try changing the apollo version in your project gradle file, ie. mine worked with

classpath 'com.apollographql.apollo:gradle-plugin:0.3.1

and it was 0.3.2 originally.

Had the same issue with prodRelease config, fixed by renaming prod flavor. In apps build.gradle I have:

buildTypes { 
  debug {...}
  release {...}
}
productFlavors {
  dev {...}
  stage {...}
  prod {...}
}

which gives me 6 buildVariants

devDebug
devRelease
stageDebug
stageRelease
prodDebug
prodRelease

top 5 were building without a problems locally and on CI, while prodRelease was giving me the same error as you described without any logical explanation. GraphQL files are the same for dev, stage and prod... I've tried to create specific folders for "prod" then for "prodRelease", checked their access rights - all the same for all variants, nothing helped. And prodDebug were building correctly all the time. Then I've renamed prod flavor(don't forget to rename graphql files folder accordingly) and it now works like a charm.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!