Ad

Android Studio Can't Import A Java From 'generated_java' Folder

- 1 answer

I implement a package 'apollo-android' and generate 'FeedQuery' java file from the 'schema.json'. But I can't import that 'FeedQuery' java file to my project.

Ad

Answer

The apollo android plugin really depends on the android gradle plugin. So if your generated classes are in a java-library module, you will not be able to import them.

Assuming you placed your graphql queries in an android module, please make sure that you have created a directory structure same as your module source directory structure under /graphql

For example if your module directory structure is as follows

src/main/java/com/example/

Then create the graphql directory structure as follows.

src/main/graphql/com/example/

After doing this, clean and rebuild and try importing classes again.

Ad
source: stackoverflow.com
Ad