I am just starting to work with firebase backend applications and i have an issue that says cannot resolve symbol 'FirebaseUser' when i try to import it in to my project with:
import com.google.firebase.auth.FirebaseUser;
I have looked in to stackoverflow topics that are similar to this and most say to check my gradle compile lines which i did and they are all up to date.
here is my gradle build file (maybe i am missing something)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.ljubisa.myfirstfirebaseapp"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.firebase:firebase-client-android:2.5.2+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Related
The error is not allowing the app to run and its even after changing the value of the compileSdkVersion and buildToolVersion.
It is not allowing the code to connect with the android function present in the app gradle.
android {
compileSdkVersion 28
buildToolsVersion "26.0.3"
defaultConfig {
applicationId "com.mridul.smartbin"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-core:16.0.1'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.1'
//noinspection GradleCompatible
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.android.support:mediarouter-v7:25.3.1'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
I was trying to solve this gradle error.I imported this project by getting it from a friend of mine.It worked in his system perfectly. Seems like I have a The following issues in my gradle.
Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (27.0.2) and test app (25.4.0) differ.
The following are my gradle
Module app
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.startup.hospital"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.+'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Project gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.startup.hospital"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.+'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Just add the following in your build.gradle (:app)
configurations.all {
resolutionStrategy {
force 'com.android.support:appcompat-v7:26.+'
force 'com.android.support:support-compat:26.+'
force 'com.android.support:support-core-ui:26.+'
force 'com.android.support:support-annotations:26.+'
force 'com.android.support:recyclerview-v7:26.+'
}
}
Your espresso has already those dependencies same as you have declared above for support library with different version which is causing problem so exclude theme like below from module build.gradle file
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
here is what it should look like
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.startup.hospital"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.+'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
and Your project level build.gradle file should not have those dependencies declared again.
just added this
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
}
this code of my build.gradle(moudule app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.hn.myapplication"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:25.+'
compile 'com.android.support:recyclerview-v7:25.+'
compile 'com.android.support:support-v4:25.+'
compile 'com.android.support:design:25.+'
//compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support.constraint:constraint-layout:1.0.0'
testCompile 'junit:junit:4.12'
}
and this is my sdk tools.
I try compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
and compile 'com.android.support.constraint:constraint-layout:1.0.0'
and compile 'com.android.support.constraint:constraint-layout:1.+'
but not working. and error is
Failed to resolve: com.android.support.constraint:constraint-layout:1
who I solve this problem?
When I use compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7
this error done: install artifact and sync project
go to file -> setting -> sdk manager -> sdk tools -> then install google repository
Phone verification in my android application is not working. when i am adding AuthUI.PHONE_VERIFICATION_PROVIDER, the editor showing that cannot resolve symbol. Other verification method like Google or email are working fine.
Here is the screen-shot for this:
Here is Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.nishant.kitchenbook"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui-auth:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Upgrade your firebaseui version to the latest. Change compile 'com.firebaseui:firebase-ui-auth:1.0.1' to compile 'com.firebaseui:firebase-ui-auth:2.1.1'
i am trying to declare Firebase but it's giving error can not resolve Firebase.
i have added all the dependencies. when typing in android studio FirebaseDatabase etc are available but simple Firebase is not.
here are my dependencies
enter code here
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.doctor.lenovo.mvprecovery"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Make sure you have the lastest version of Google Repository (You can update to a newer version in SDK Manager tab)