Apollo-android: models are generated but not resolved

Created on 21 Jun 2019  路  7Comments  路  Source: apollographql/apollo-android

I have been using this for about 3 months and everything was fine. But just recently I get unresolved reference every where apollo model is imported, every model is red.

    //Apollo
    //implementation 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha5'
    implementation 'com.apollographql.apollo:apollo-http-cache:1.0.0-alpha5'
    implementation "com.apollographql.apollo:apollo-coroutine-support:1.0.0-alpha5"

    //remove the snapshot when stable is released.
    implementation 'com.apollographql.apollo:apollo-runtime:1.0.1-SNAPSHOT'

I am using snapshot because of upload functionality.

I tried to move apply plugin: 'com.apollographql.android' just below apply plugin: 'com.android.application' like sav007 did in the sample here but still everything is unresolved. What should I do

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs"
apply plugin: 'com.apollographql.android'

All 7 comments

I have the same problem.

2 days ago they updated the plugin.

imagen

Thanks for your help :D

@Dragons0458 for the time being I just removed snapshot. Hope we find solution soon.

I think it's related to https://github.com/apollographql/apollo-android/issues/1381

Look in your *.iml file, and check that the test source line doesn't exist. You can also "reload" it by setting test to true then back to false.

In the end I'm probably just going to add it as a srcDirs since even that solution is temporary

https://github.com/apollographql/apollo-android/issues/1372#issuecomment-502552241

Hello! with the #1381 my problem was solved, thank you very much! :D

And thank you @teknolojia for your help 馃憤 :D

Just to clarify:

1) Is this issue happens for pure kotlin projects?
2) Do you set in your apollo configuration generateKotlinModels = true?

For me it's a pure kotlin project without generated kotlin models.

I believe it was fixed, closing for now.

Was this page helpful?
0 / 5 - 0 ratings