Android - Firebase Database Quickstart Gradle Project Sync Failed - android

I am trying to build this project Firebase Database Quickstart, but I am facing error in App level build.gradle file.
Here is my error message
By searching google and stackoverflow i found some solution then i add this 'com.google.android.gms:play-services-auth:15.0.1' line in my gradle file so my error reduces from 6 to 3.
Error message after adding this 'com.google.android.gms:play-services-auth:15.0.1'
Now i am unable to fix this error.
My Google Play services and Google Repository version is up to date and maven { url "https://maven.google.com" } is already added before in the project level build.gradle.
Here my App Level gradle file:
apply plugin: 'com.android.application'
check.dependsOn 'assembleDebugAndroidTest'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.google.firebase.quickstart.database"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}
dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
// Needed to fix a dependency conflict with FirebaseUI'
implementation 'android.arch.core:runtime:1.1.1'
// Needed to fix a dependency conflict with FirebaseUI'
implementation 'android.arch.core:runtime:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
}
apply plugin: 'com.google.gms.google-services'

Try to Add below repositories in Top-Level gradle.
google(), mavenLocal() and jcenter()
I was getting same issue and i resolved by adding these.

Related

Shows Please make sure you have the required dependencies in the classpath: class com.google.android.gms.vision.barcode.Barcode

Everything was working fine until I added implementation 'com.google.android.gms:play-services-ads:18.2.0' this dependency for showing ads in-app.
I am getting below error message while building the application. error gets removed if I remove ad library.
Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class com.google.android.gms.vision.barcode.Barcode, unresolved supertypes: com.google.android.gms.internal.zzbck
App level build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.creatorisone.chargingtheftsecurityalarm"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.04"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), "proguard-rules.pro"
}
}
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains', module: 'annotations'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'org.jetbrains:annotations-java5:17.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50"
implementation 'xyz.belvi.mobilevision:barcodescanner:2.0.3'
implementation 'androidx.fragment:fragment:1.2.0-alpha02'
implementation 'com.google.zxing:core:3.3.3'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
implementation 'com.google.android.gms:play-services-ads:18.2.0'
}
repositories {
mavenCentral()
}
I have tried multiple solutions provided on StackOverflow but nothing is working in my case
"Error: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath"
error in Location Request class in android with kotlin
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath
"Supertypes of the following classes cannot be resolved.” in Task:app:buildInfoGeneratorDebug
I have faced same problem and its resolve by adding
implementation 'com.google.android.gms:play-services-vision:15.0.2'

I can't seem to build my android application when I'm signing it

I can build the application when it's not signed but every time I try to sign Android Studio says something along the lines of
"ERROR: Failed to resolve: com.android.support.cardview-v7:27.1.1"
I've checked this and verified it exists but it doesn't seem to work, it gives other dependency issues if I try to fix it.
"My build.gradle (app)"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "uk.org.cetma.llanellistandard"
minSdkVersion 23
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'
}
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven
Central
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:support-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.squareup.picasso:picasso:2.71828'
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'
//Add Library
implementation 'com.android.support.cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-27.1.0'
implementation 'com.google.code.gson:gson:2.8.2'
}
I want it to sign the application so I can make sure it still works.
Below is an example of the error I get:
ERROR: Failed to resolve: com.android.support.cardview-v7:27.1.1:
Affected Modules: app
double dots are missing from your card view dependency use this -
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
try with
implementation 'com.android.support:cardview-v7:27.1.1'

Android Studio 3.4: Changing the value for a property with a final value has been deprecated. This will fail with an error in Gradle 6.0

I get the following warning in the Build Output console of Android Studio 3.4:
Task :app:processDebugResources
Changing the value for a property with a final value has been deprecated. This will fail with an error in Gradle 6.0.
Here's my build.gradle(Module:app) file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.xscoder.myapp"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
aaptOptions { cruncherEnabled = false }
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions { javaMaxHeapSize "4g" }
}
repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
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'
testImplementation 'junit:junit:4.12'
// Parse
implementation "com.github.parse-community.Parse-SDK-Android:parse:1.18.6"
implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.18.6"
implementation 'com.parse.bolts:bolts-android:1.4.0'
// CircleImageView
implementation 'de.hdodenhof:circleimageview:3.0.0'
// Facebook
implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
implementation 'com.parse:parsefacebookutils-v4-android:1.10.7#aar'
// Google & Firebase
implementation 'com.google.android.gms:play-services-ads:17.2.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
}
apply plugin: 'com.google.gms.google-services'
Everything is fine, the app runs smoothly, but what I'm wondering is when Gradle 6.0 will be available, so what may cause that task deprecation?
Try to Run this may this will help
./gradlew clean
rm -rf ~/.gradle/caches/*

Firebase authentication and database linking

In android studio 3.1.3, for linking firebase auth "implementation 'com.google.firebase:firebase-auth:11.6.0'" and
for linking firebase database "implementation 'com.google.firebase:firebase-database:11.8.0'" are the default dependencies provided in app level gradle.
classpath 'com.google.gms:google-services:3.0.0' is the dependency added
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.project.arsalan.adda"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://maven.google.com/"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:9.8.0'
implementation 'com.google.firebase:firebase-auth:9.8.0'
implementation 'com.google.firebase:firebase-database:9.8.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.android.support:cardview-v7:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.yarolegovich:lovely-dialog:1.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:percent:25.0.1'
}
apply plugin: 'com.google.gms.google-services'
in project level gradle.
I'm usung gradle 3.1.2
The different levels of firebase are causing me errors. Please provide a common level of firebase version that can be used with my gradle build.
just update them with
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
and your google gms update with
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
// ...
}
Here is a link to see the latest Firebase SDK versions. I think it is a reasonable assumption to make that the latest ones will work together.
https://firebase.google.com/support/release-notes/android
I dunno if this problem's unique to Linux.. but anyway finally I had to downgrade the dependencies to get them working..
Module app (dependencies)
compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.google.firebase:firebase-auth:9.8.0'
Project
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'

version conflict firebase libraries

I am getting this error:
Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is
available at
https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 16.0.1.
I think the error I am getting is due to implementing com.google.firebase:firebase-messaging:17.1.0 because if I remove it, building is successful. But on trying version 16.0.1 of com.google.android.gms for messaging, I get this message:
Unable to resolve error
I think the error means that com.google.firebase:firebase-messaging:16.0.1 is unavailable. How can my problem be solved ?
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
defaultConfig {
applicationId "in.anamika.anamika"
minSdkVersion 15
targetSdkVersion 27
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 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.7'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
in Android studio there are 2 buld gradle file.
build.gradle (Project: ProjectName)
build.gradle (Module: App)
I failed to upgrade com.google.firebase:firebase-messaging:17.1.0 too and then I edit classpath 'com.google.gms:google-services:3.0.1' to classpath 'com.google.gms:google-services:4.0.1'in build.gradle (Project: ProjectName) and it works. i can finally upgrade to 17.1.0.
Check this out
You need to search over your native dependecies in node_modules for their build.gradle and in this files look for dependecies starting with com.google.android.gms or com.google.firebase. After that you need to exclude these internal dependecies and force use of same version everywhere.

Categories

Resources