0

I'm working on a project. I started with updating the libraries after not touching the project for around a year or so. Updated most of the libraries except implementation 'com.google.android.gms:play-services-maps:9.2.1' and implementation 'com.google.android.gms:play-services-gcm:9.2.1' because there is an older version of a library supplying push for me, which I can't update right now. Anyways, after a while I opened some classes and noticed that for example SupportMapFragment is red and says "Unresolved reference". This happens with every class that comes out of the two libraries. However, the project still runs and still works as expected.

Why is this happening? And how can I fix it?


I will list some other libraries which could have an influence below:

  • $support_library_version = '27.1.0'
  • implementation "com.android.support:appcompat-v7:$support_library_version"
  • implementation "com.android.support:recyclerview-v7:$support_library_version"
  • implementation "com.android.support:cardview-v7:$support_library_version"
  • implementation "com.android.support:design:$support_library_version"
  • implementation 'com.squareup.retrofit2:retrofit:2.3.0'
  • implementation 'com.squareup.picasso:picasso:2.5.2'
  • implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { transitive = true; }

They got updated from these versions:

  • $support_library_version = '24.1.1'
  • compile 'com.squareup.retrofit2:retrofit:2.0.2'
  • compile 'com.squareup.picasso:picasso:2.5.2'
  • Crashlytics was not added in previous versions
Kevin van Mierlo
  • 9,554
  • 5
  • 44
  • 76

2 Answers2

0

I was experiencing a similar issue earlier today and used the instructions from this post to fix it:

File->Invalidate Caches/Restart

In addition, it appears that Gradle 3.1.0 doesn't work, but Gradle 2.3.0 does.

  • I already tried invalidate caches/restart, cleaning, rebuilding resyncing gradle, restarting my computer, deleting the build folders. It just stays red. Reverting gradle to 2.3.0 I haven't tried yet. But I'd rather not downgrade gradle build tools – Kevin van Mierlo Apr 06 '18 at 06:52
0

Apparently the version I had for GCM and maps was too low. I had to update to a higher version and the unresolved references disappeared. I'm using 11.8.0 right now.

Kevin van Mierlo
  • 9,554
  • 5
  • 44
  • 76