here i am using room database for first time and here is error in gradle building .
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.projectcow"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
def room_version = "2.2.5"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:$room_version"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:$room_version"
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"
implementation 'com.google.android.material:material:1.1.0'
} here is my error box: Executing tasks: [:app:assembleDebug] in project C:\Users\Imran\Desktop\projectcow
Task :app:preBuild UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :app:compileDebugAidl NO-SOURCE Task :app:generateDebugBuildConfig UP-TO-DATE Task :app:javaPreCompileDebug FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:javaPreCompileDebug'.
Could not resolve all files for configuration ':app:debugAnnotationProcessorClasspath'. Could not download room-compiler.jar (androidx.room:room-compiler:2.2.5): No cached version available for offline mode Could not download kotlinx-metadata-jvm.jar (org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.0.5): No cached version available for offline mode Could not download auto-common.jar (com.google.auto:auto-common:0.10): No cached version available for offline mode Could not download auto-value-annotations.jar (com.google.auto.value:auto-value-annotations:1.6.3): No cached version available for offline mode Could not download javapoet.jar (com.squareup:javapoet:1.8.0): No cached version available for offline mode Could not download antlr4.jar (org.antlr:antlr4:4.7.1): No cached version available for offline mode Could not download sqlite-jdbc.jar (org.xerial:sqlite-jdbc:3.25.2): No cached version available for offline mode Could not download guava.jar (com.google.guava:guava:23.5-jre): No cached version available for offline mode Could not download antlr4-runtime.jar (org.antlr:antlr4-runtime:4.7.1): No cached version available for offline mode Could not download ST4.jar (org.antlr:ST4:4.0.8): No cached version available for offline mode
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s 2 actionable tasks: 1 executed, 1 up-to-date