Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Could not determine artifacts for androidx.cardview:cardview:1.0.0: No cached version available for offline mode

I want to make an implementation of the library of card-view and library of recycleview but the following error shows up after building or syncing the project:

ERROR: Could not determine artifacts for androidx.cardview:cardview:1.0.0: No cached version available for offline mode

What steps do I need to take to eliminate this sync error?

like image 771
Gerges Elbana Avatar asked Mar 03 '23 08:03

Gerges Elbana


2 Answers

As answered by @SaadAakash I didn't find any offline work check box under Gradle in Android Studio Preference in my Mac.

After searching for a while I found another way to switch off offline work

Go to View menu in toolbar and navigate to Tool Windows and select Gradle enter image description here

Gradle pane will open in right side, toggle offline work switch enter image description here

and sync the Gradle once again.

Hope it should work!

like image 53
Shadman Akhtar Avatar answered May 10 '23 13:05

Shadman Akhtar


Go to the following path in your Android Studio:

File > Settings > Build, Execution, Deployment > Gradle

Then under Global Gradle Settings, uncheck the Offline work option. Hit Apply and then Okay. Sync the project again, make sure you have Internet Connectivity and it should work.

like image 22
SaadAAkash Avatar answered May 10 '23 14:05

SaadAAkash