Could not determine artifacts for androidx.appcompat:appcompat:1.0.2: No cached version available for offline mode
Gradle Dependencies are:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.hendraanggrian.material:collapsingtoolbarlayout-subtitle:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
Gradle Project Sync failed every time after clean and rebuild.
- To resolve this issue please Turn off Gradle offline mode.
-
Just go to (android studio 3.6 and above)
View -> Tool Window -> Gradle -> Toggle Offline Mode Icon
Click here to see the Toggle Offline Mode Icon
Gradle is in offline mode, which means that it won't go to the network to resolve dependencies.
Go to Preferences (File->Settings->Build, Execution, Deployment) -> Gradle and uncheck "Offline work".