I tried to restart Android Studio but the problem still existed.
Then the solution works with me.
- Remove the directory
~/.gradle/caches/
. It’s OK to do this while Android Studio is opened.
(Refer pm installing wrong package name) - Press “Sync project with Gradle files” icon on Android Studio
- Run the project and the remote path will be correct.