Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio cannot resolve but build successfully after update

It's start after I update Android studio to version 3.1 stable, then I open my project, Android studio start to complain that can't resolve bla bla bla... (many import become red)

What I did so far :

  1. Sync gradle
  2. Clean build then rebuild
  3. Invalidate cache and restart
  4. Deleting .gradle folder in project
  5. Deleting .gradle/cache folder in user folder (i'm on Windows)
  6. Uninstall and reinstall Android studio

But so far the issue is not resolved, some things to note :

  1. I use kotlin
  2. I still can build and deploy the apk
  3. The unresolved reference seems only on library that I added on gradle
  4. If I downgrade or upgrade the library, this seems fix the problem, but when I back to the original library version the issue came back.
like image 506
nyongrand Avatar asked Mar 07 '23 13:03

nyongrand


1 Answers

  1. Exit from Studio
  2. Delete .idea/, build/, app/build/ directories.
  3. Start Studio.
  4. Re-setup Settings->Build tools->Gradle to use local distribution (last stable Gradle locally installed)

Helps me.

like image 99
Slava Glushenkov Avatar answered Mar 10 '23 09:03

Slava Glushenkov