Home > Blockchain >  Android Studio is showing Unresolved reference: Gson even though I have it in gradle and it works
Android Studio is showing Unresolved reference: Gson even though I have it in gradle and it works

Time:10-21

After upgrading to gradle version 7, Gson is showing like it's missing, but it's actually is working.

I have it in gradle the same way I had before. Everything works fine, but Android Studio is marking all uses of Gson as Unresolved reference. It's not a huge problem, but I dont want a lot of my files to be marked as error in A.S.

I have tried to clean, rebuild and invalidate caches.

Any suggestions? :)

Gson gradle dependency

Gson usage showing error

Import from Gson library showing error

CodePudding user response:

If it's not working to Invalidate caches -> try com.google.code.gson:gson:2.8.8 updating package.

Worth to mention: Android Studio does apperantly not always suggest the newest version in gradle. Check the dependency's repo to see the latest version.

  • Related