-
-
Save sagar-viradiya/ea05cdeb8471ca028dd361e53512189e to your computer and use it in GitHub Desktop.
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
apply plugin: "kotlin-kapt" | |
android { | |
compileSdkVersion 29 | |
defaultConfig { | |
applicationId "com.devfest.india.bmsclone" | |
minSdkVersion 21 | |
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' | |
} | |
} | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
kotlinOptions { | |
jvmTarget = "1.8" | |
} | |
} | |
dependencies { | |
implementation fileTree(dir: "libs", include: ["*.jar"]) | |
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | |
implementation 'androidx.core:core-ktx:1.3.1' | |
implementation 'androidx.appcompat:appcompat:1.2.0' | |
implementation 'com.google.android.material:material:1.2.1' | |
implementation 'androidx.constraintlayout:constraintlayout:2.0.1' | |
testImplementation 'junit:junit:4.13' | |
androidTestImplementation 'androidx.test.ext:junit:1.1.2' | |
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' | |
//Retrofit for Networking | |
implementation 'com.squareup.retrofit2:retrofit:2.9.0' | |
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' | |
//Glide Image Loading Library | |
implementation 'com.github.bumptech.glide:glide:4.11.0' | |
//Room DB for database | |
implementation "androidx.room:room-runtime:2.2.5" | |
kapt "androidx.room:room-compiler:2.2.5" | |
kapt "androidx.lifecycle:lifecycle-compiler:2.2.0" | |
// ViewModel | |
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" | |
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0" | |
} |
Giving error at line 55: kapt "androidx.room:room-compiler:2.2.5"
I forgot to add :
apply plugin: 'kotlin-android-extensions'
apply plugin: "kotlin-kapt"
Now it's working fine
@sharath2106 add it within the app folder
For those getting Errors
please add
apply plugin: 'kotlin-kapt'
outside of dependencies else kapt wil not be recognized by gradle
Also add the dependencies for recyclerView and Material Components
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
Thanks
A problem occurred evaluating root project 'BookMyShow Clone'.
Could not initialize class org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt
There's this error i'm getting
In dependencies
change
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.google.android.material:material:1.2.1
to
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
implementation("com.google.android.material:material:1.3.0-alpha03")
Thanks for answering @ansulagrawal . @anubhavbagri Let me know if you are still struggling with issue.
@sanchitsharma1 Make sure you have installed the SDK platform for android version 29. Go to SDK Manager (You can find it in the toolbar on top) -> SDK platform tab and choose Android 10.0 -> click on Apply below. After installation this should have been fix.
Can I get a java version of this file since I know java only.
@vikhyat187 this file uses groovy language. Gradle build system is based on groovy language.
Giving error at line 55: kapt "androidx.room:room-compiler:2.2.5"