Apollo-android: Codegen broken within last few hours

Created on 17 Jun 2019  路  5Comments  路  Source: apollographql/apollo-android

It appears as though a recent change has broken imports for 1.0.1-SNAPSHOT.
My project suddenly started failing to build, and reverting to old commits didn't work either.

Looking in the class folder, it appears as though CustomTypes are properly generated. However, gradle wouldn't pick up on the usage. The IDE itself complains that it isn't there, though autocompletion still works.

Attaching relevant Travis logs:

Most helpful comment

You can quickly solve the issue by force adding gen dir to the classpath:

sourceSets {
        main {
            java {
                srcDirs 'src/main/java'
                srcDirs 'build/generated/source/apollo/classes'
            }
        }
    }

But this is a workaround.

All 5 comments

Judging by the commit history, I'd imagine the fault lies in https://github.com/apollographql/apollo-android/commit/a1cd963f632e2a5d333b9d34e90107b9b5e6733f, and it might be because the apollo tasks comes after the project?

I did not understand why he put this into 1.0.1-SNAPSHOT when it is supposed to be snapshot on the next number
sona repo listing Updated on Sun Jun 16 23:40:59 UTC 2019

I had 2 projects run on apollo-android, none of them is able to compile Unresolved reference: graphql
Some of the build files were not properly built.

For now I rolled back to 1.0.0

You can quickly solve the issue by force adding gen dir to the classpath:

sourceSets {
        main {
            java {
                srcDirs 'src/main/java'
                srcDirs 'build/generated/source/apollo/classes'
            }
        }
    }

But this is a workaround.

Sorry guys we have made some changes to our gradle plugin that caused this issue.
Are your projects is Kotlin projects?

If yes, is this fix works for you: https://github.com/apollographql/apollo-android/pull/1374/commits/8882237cfa40e07955dac83e5f88b30c5f776d88

That does seem to fix it. I'll close the issue for now since it seems to be resolved

Was this page helpful?
0 / 5 - 0 ratings