After adding dependencies having this error, anyone know how to fix? - android

I am trying to create a new project based on MVVM and was adding all the dependencies needed.
This is what i had added and done so far :
Added dependencies inside gradle file
Added plugin
Enabled dataBinding to true
Added classpath in gradle file
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0-alpha05"
Added android.databinding.enableV2=true
inside gradle.properties
I am following guide from this youtube playlist :
https://www.youtube.com/watch?v=Rd5dLmKewqg&list=PLk7v1Z2rk4hjVaZ8DZKe8iT9RIM9OUrwp&index=2
Things i had tried so far :
I had checked if
android.useAndroidX=true and android.enableJetifier=true
Replaced to minifyEnable false inside the gradle file
The app cannot even compile and have been showing error
This is my gradle project file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0-alpha05"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my gradle Module:app file :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//kotlin kapt and navigation safeargs plugin
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs"
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.mvvmsampleapp"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
[This is the error][1]}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//Retrofit and GSON
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
//Kotlin Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1"
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
//New Material Design
implementation 'com.google.android.material:material:1.1.0-alpha07'
//Kodein Dependency Injection
implementation "org.kodein.di:kodein-di-generic-jvm:6.2.1"
implementation "org.kodein.di:kodein-di-framework-android-x:6.2.1"
//Android Room
implementation "androidx.room:room-runtime:2.1.0-rc01"
implementation "androidx.room:room-ktx:2.1.0-rc01"
kapt "androidx.room:room-compiler:2.1.0-rc01"
//Android Navigation Architecture
implementation "androidx.navigation:navigation-fragment-ktx:2.1.0-alpha05"
implementation "androidx.navigation:navigation-ui-ktx:2.1.0-alpha05"
implementation 'com.xwray:groupie:2.3.0'
implementation 'com.xwray:groupie-kotlin-android-extensions:2.3.0'
implementation 'com.xwray:groupie-databinding:2.3.0'
}
This is my error message
/Users/garylim/Downloads/MVVMSampleApp/app/build/generated/source/kapt/debug/com/example/mvvmsampleapp/DataBinderMapperImpl.java:9: error: cannot find symbol
import com.example.mvvmsampleapp.databinding.ActivityLoginBindingImpl;
^
symbol: class ActivityLoginBindingImpl
location: package com.example.mvvmsampleapp.databinding
P.S. Cannot post image yet

Related

Unresolved reference #HiltAndroidApp or any other Hilt annotation in Android

I have done everything properly but still, I can't use Hilt in my project.
build.gradle(:app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
buildFeatures{
viewBinding = true
dataBinding = true
}
defaultConfig {
applicationId "com.emptysheet.pdfreader_autoscroll"
minSdkVersion 16
targetSdkVersion 29
versionCode 7
versionName "1.7"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)
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-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(path: ':android-pdf-viewer')
//firebase for crashlytics
implementation 'com.google.firebase:firebase-analytics-ktx:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.0.1'
// for ads
implementation 'com.google.android.gms:play-services-ads:19.1.0'
// multidex
//room
implementation 'androidx.room:room-ktx:2.2.5'
kapt "androidx.room:room-compiler:2.2.5"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
//debug database
debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0'
//support for APK less than 21
implementation 'androidx.multidex:multidex:2.0.1'
// in app billing
implementation 'com.android.billingclient:billing-ktx:3.0.0'
// Hilt
implementation "com.google.dagger:hilt-android:2.28-alpha"
kapt "com.google.dagger:hilt-android-compiler:2.28-alpha"
}
build.gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.28-alpha'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
When I am using #HiltAndroidApp or any other Hilt annotation. It says Unresolved reference. Create annotation. I have tried re-installing Hilt but it's still not working.
I am also using Android Studio 4.0
Try the usual:
File -> Invalidate Caches / Restart ... (and click Invalidate and Restart)
From the toolbar, press 'Sync Project with Gradle Files'.
Invalidate Caches / Restart

Android: While running test cases: Could not determine the dependencies of task ':app:compileDebugAndroidTestJavaWithJavac'

I recently stated writing test cases. I am using JUnit and Barista for the same.
My app is compiling successfully and running but when I run test cases it is showing me following error:
Could not determine the dependencies of task ':app:compileDebugAndroidTestJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugAndroidTestCompileClasspath'.
> Could not find org.mockito:mockito-core:3.0.6.
Required by:
project :app
> Could not find org.mockito:mockito-android:3.0.6.
Required by:
project :app
> Could not find org.mockito:mockito-core:3.0.6.
Required by:
project :app > com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0
> Could not find org.mockito:mockito-core:3.0.6.
Required by:
project :app > androidx.arch.core:core-testing:2.0.0
> Could not find org.mockito:mockito-core:3.0.6.
Required by:
project :app > org.mockito:mockito-inline:2.21.0
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
I am not sure why this is happening I am missing one small thing here.
I have tried all the other similar questions on the stack overflow but problem still persists.
Here is my app level build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs'
//Added for Epoxy
kapt {
correctErrorTypes = true
}
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.example.githubdemo"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner = "com.example.githubdemo.TestRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug{}
uat{}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// ReactiveX
implementation "io.reactivex.rxjava2:rxjava:$rxjava_version"
implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version"
// Rx
implementation("com.jakewharton.rxbinding2:rxbinding-kotlin:2.2.0")
implementation("com.jakewharton.rxbinding2:rxbinding-support-v4-kotlin:2.2.0")
implementation("com.jakewharton.rxbinding2:rxbinding-appcompat-v7-kotlin:2.2.0")
implementation("com.patloew.rxlocation:rxlocation:1.0.5")
androidTestImplementation 'com.squareup.rx.idler:rx2-idler:0.10.0'
// Retrofit2
implementation "com.squareup.retrofit2:retrofit:$retrofit2_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit2_version"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit2_version"
// Picasso
implementation "com.squareup.picasso:picasso:$picasso_version"
// Koin
implementation "org.koin:koin-android-viewmodel:2.0.1"
def nav_version = "2.1.0"
implementation "android.arch.navigation:navigation-fragment-ktx:$nav_version"
implementation "android.arch.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.navigation:navigation-fragment:2.1.0"
implementation "androidx.navigation:navigation-ui-ktx:2.1.0"
implementation "androidx.navigation:navigation-fragment-ktx:2.1.0"
//Airbnb Epoxy
def epoxyVersion = "3.9.0"
implementation "com.airbnb.android:epoxy:$epoxyVersion"
kapt "com.airbnb.android:epoxy-processor:$epoxyVersion"
implementation "com.airbnb.android:epoxy-databinding:$epoxyVersion"
//MvRx
implementation 'com.airbnb.android:mvrx:2.0.0-alpha2'
testImplementation 'com.airbnb.android:mvrx-testing:2.0.0-alpha2'
androidTestImplementation("com.airbnb.android:mvrx-testing:2.0.0-alpha2")
// Testing Libs
androidTestImplementation('org.mockito:mockito-core:3.0.6')
androidTestImplementation('org.mockito:mockito-android:3.0.6')
androidTestImplementation('com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.5.2')
testImplementation('org.spekframework.spek2:spek-dsl-jvm:2.0.8')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.5.2')
testRuntimeOnly('org.spekframework.spek2:spek-runner-junit5:2.0.8')
debugImplementation('androidx.fragment:fragment-testing:1.2.0-rc02')
androidTestImplementation('androidx.arch.core:core-testing:2.0.0')
androidTestImplementation('androidx.test.ext:junit:1.1.0')
androidTestImplementation('androidx.test:runner:1.1.0')
androidTestImplementation('androidx.test:core:1.1.0')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1')
androidTestImplementation('androidx.test.espresso:espresso-idling-resource:3.1.1')
androidTestImplementation('androidx.test.espresso.idling:idling-concurrent:3.2.0')
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.1.1')
androidTestImplementation('androidx.test.espresso:espresso-intents:3.1.1')
androidTestImplementation('com.schibsted.spain:barista:3.2.0')
androidTestImplementation('org.opentest4j:opentest4j:1.2.0')
androidTestImplementation('com.squareup.okhttp3:mockwebserver:4.2.2')
androidTestImplementation('com.jakewharton.espresso:okhttp3-idling-resource:1.0.0')
// Koin
androidTestImplementation('org.koin:koin-test:2.0.1')
// Recyclerview Child Actions for Espresso
implementation('it.xabaras.android.espresso:recyclerview-child-actions:1.0')
//Input mask
implementation('com.redmadrobot:input-mask-android:5.0.0')
}
Here is my Project level build.gradle file:
buildscript {
ext.kotlin_version = "1.3.61"
ext.rxjava_version = '2.2.10'
ext.rxkotlin_version = '2.4.0'
ext.rxandroid_version = '2.1.1'
ext.retrofit2_version = '2.6.2'
ext.picasso_version = '2.71828'
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
maven{
url 'https://jitpack.io'
}
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0-alpha07"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Am I missing something?
Did you try to remove redundant dependency from build.gradle and try rebuilding the project. I faced the similar issue and got to solve by this

Annotation processors must be explicitly declared now. The following dependencies on the compile classpath?

I am developing new app using android architecture components but I am getting the following error from gradle
Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- lifecycle-compiler-2.0.0.jar (androidx.lifecycle:lifecycle-compiler:2.0.0)
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for
below is my app.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.lifecycleawaredemo"
minSdkVersion 15
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.lifecycle:lifecycle-compiler:2.0.0'
def lifecyle_version = "1.1.1"
implementation "android.arch.lifecycle:extensions:$lifecyle_version"
implementation "android.arch.lifecycle:compiler:$lifecyle_version"
}
below my build.gradle
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
First of all, you appear to be mixing up your androidx lifecycle dependencies. You are using androidx artifacts, so you can drop this part:
def lifecyle_version = "1.1.1"
implementation "android.arch.lifecycle:extensions:$lifecyle_version"
implementation "android.arch.lifecycle:compiler:$lifecyle_version"
You should only need:
implementation 'androidx.lifecycle:lifecycle-compiler:2.0.0'
Now, as to the error, the message says that the lifecycle-compiler contains annotation processors, so you should add them to the annotationProcessor configuration. To do this, add the following line at the apply plugin section for your app.gradle:
apply plugin: 'kotlin-kapt'
This will enable the kotlin annotation processor support. Next, change the:
implementation 'androidx.lifecycle:lifecycle-compiler:2.0.0'
to allow the compiler to use the included annotation processors:
kapt 'androidx.lifecycle:lifecycle-compiler:2.0.0'
and that should compile fine.

ERROR: Failed to resolve: androidx.room:room-runtime:1.0.0

I am learning android mvvm tutorial but I am getting following errors from gradle
ERROR: Failed to resolve: androidx.room:room-runtime:1.0.0
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: org.kodein.di:kodein-di-generic-jvm:1.0.0
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: org.kodein.di:kodein-di-framework-android-x:1.0.0
Show in Project Structure dialog
Affected Modules: app
below my app.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: "kotlin-kapt"
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.forecastmvvm"
minSdkVersion 15
targetSdkVersion 28
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.0.0"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation "android.arch.navigation:navigation-fragment:1.0.0"
implementation "android.arch.navigation:navigation-ui:1.0.0"
implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0"
implementation "android.arch.navigation:navigation-ui-ktx:1.0.0"
implementation "androidx.core:core-ktx:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
// Room
implementation "androidx.room:room-runtime:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0'
kapt "androidx.room:room-compiler:1.0.0"
// Gson
implementation "com.google.code.gson:gson:2.8.5"
// Kotlin Android Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0"
// Retrofit
implementation "com.squareup.retrofit2:retrofit:2.0.0"
implementation "com.squareup.retrofit2:converter-gson:2.0.0"
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
// ViewModel
implementation "androidx.lifecycle:lifecycle-extensions:1.0.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:1.0.0"
kapt "androidx.lifecycle:lifecycle-compiler:1.0.0"
// Kodein
implementation "org.kodein.di:kodein-di-generic-jvm:1.0.0"
implementation "org.kodein.di:kodein-di-framework-android-x:1.0.0"
// Better dateTime-time support even on older Android versions
implementation "com.jakewharton.threetenabp:threetenabp:1.1.0"
// Glide
implementation 'com.github.bumptech.glide:glide:4.8.0'
kapt 'com.github.bumptech.glide:compiler:4.8.0'
// Groupie RecyclerView
implementation 'com.xwray:groupie:2.1.0'
implementation 'com.xwray:groupie-kotlin-android-extensions:2.1.0'
// Preference
implementation "androidx.preference:preference:1.0.0"
// WeatherLocation
implementation "com.google.android.gms:play-services-location:16.0.0"
// New Material Design
implementation "com.google.android.material:material:1.0.0"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
below gradle
buildscript {
ext.kotlin_version = '1.3.41'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Modify
androidx.room:room-runtime:1.0.0
org.kodein.di:kodein-di-generic-jvm:1.0.0
org.kodein.di:kodein-di-framework-android-x:1.0.0
to
androidx.room:room-runtime:2.1.0
org.kodein.di:kodein-di-generic-jvm:6.3.3
org.kodein.di:kodein-di-framework-android-x:6.3.3
Also, check for other dependencies, you might have entered wrong versions or not the latest one.

Adding firebase dependency causes gradle sync to fail

I added the firebase database dependency via the Tools->Firebase->Add Real Time Database to your app method, and this causes my gradle sync to fail. I'm guessing either there is a conflict in dependencies (because I have already set up google sign in for my app using firebase and everything is working fine) or the wrong dependency was loaded
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
Module Gradle File:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "nus.is3261.kotlinapp"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.shaishavgandhi:login-buttons:1.0.0'
compile 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
}
apply plugin: 'com.google.gms.google-services'
Project Gradle File:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.70'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Try to Replace
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
with
implementation 'com.google.firebase:firebase-database:16.0.4'

Categories

Resources