After I have added the firebase ads dependency implementation'com.google.firebase:firebase-ads:15.0.1'
now I am getting the followiing Error:
Error:The library com.google.firebase:firebase-analytics is being requested by various other libraries at [[15.0.1,16.0.0), [16.0.0,16.0.0], [16.0.0,99999]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
but I haven't added a analytics dependency since I don't need that, but I added it anyway to see weather it solves the problem but I am still getting the same error
the following is my build.gradle(module app)
//noinspection GradleCompatible
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.rimapps.midippu"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:support-annotations:27.1.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
//noinspection GradleDynamicVersion
implementation 'com.android.support:cardview-v7:26.1.0+'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.0'
apply plugin: 'com.google.gms.google-services'
implementation'com.google.firebase:firebase-analytics:16.0.0'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
Is there anything I can do?
It worked after I updated my classpath dependency to classpath 'com.google.gms:google-services:4.0.1' in my project gradle
Related
the app already had implementation 'com.android.support:appcompat-v7:26.0.0'.so to stay updated i changed it to 28.0.0. and i still get the Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. error.
how can i solve this error permanently.
i've tried a lot of different solutions provided to similar kind of problems but didn't work.
updated
build.gradle down below
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "man.ravi.app"
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
multiDexEnabled true
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:26.1.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.adefruandta.spinningwheel:spinningwheel:0.1.0'
implementation 'com.google.firebase:firebase-core:10.0.1'
implementation 'com.google.firebase:firebase-database:10.0.1'
implementation 'org.immutables:gson:2.6.1'
implementation 'com.google.android.gms:play-services:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'
implementation 'com.google.android.gms:play-services-ads:10.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'gun0912.ted:tedpermission:2.1.0'
}
apply plugin: 'com.google.gms.google-services'
btw..you can `ignore the compileSdkVersion on the Top. it used to be implementationSdkVersion which resulted in a bunch of other erros..then i changed it to compileSdkVersion.
In my case i just update Google service in project level gradle.
classpath 'com.google.gms:google-services:3.2.0'
The library com.google.android.gms:play-services-basement is being
requested by various other libraries at [[15.0.1,15.0.1]], but
resolves to 16.0.1. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies
I´ve got this error and can´t solve it. I tried everything I found, but nothing worked. Do you have an idea.
I wanted to implement implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.alexa.oneline"
minSdkVersion 15
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
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.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
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'
//LifeData
implementation 'android.arch.lifecycle:extensions:1.1.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
//room db
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
//Firebase
implementation 'com.google.firebase:firebase-core:17.3.2'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
}
apply plugin: 'com.google.gms.google-services'
firebase-core latest version is: 16.0.4 but the Firestore version seems to be all good.
So, change your dependencies to:
//Firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
Then add;
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Right after:
apply plugin: 'com.google.gms.google-services'
In your build.gradle.
I am working on android applications where I am working on Google maps and Firebase. I am putting latest links in my gradle file but it is giving me an error with a red line on GoogleMaps gradle link.
Error:
all gms/firebase libraries must use the exact same version specification (mixinb versions can lead to runtime crahes). Found versions 16.0.0, 15.0.4, 15.0.1. Examples include com.google.firbase:firebase-analytics:16.0.0 and com.google.android.gms:play-services-measurement-base:15.0.4
Gradle:
dependencies{
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.firebase:firebase-core:16.0.0'
}
classpath 'com.google.gms:google-services:4.0.0'
apply plugin: 'com.google.gms.google-services'
Make your play service dependency version equal and try like bellow
dependencies{
compile 'com.google.android.gms:play-services-maps:16.0.0'
compile 'com.google.android.gms:play-services-location:16.0.0'
compile 'com.google.firebase:firebase-core:16.0.0'
}
classpath 'com.google.gms:google-services:4.0.0'
apply plugin: 'com.google.gms.google-services'
There are two more dependencies that need to be added. All the dependencies that I wrote are mentioned below.
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.firebase:firebase-core:15.0.1'
compile 'com.google.firebase:firebase-analytics:15.0.1'
compile ' com.google.android.gms:play-services-measurement-base:15.0.4'
I got a perfect combination with Android SDK API 28
No error of any sort in gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.myapp.app"
minSdkVersion 15
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 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.github.medyo:android-about-page:1.2.4'
implementation 'com.google.firebase:firebase-messaging:11.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'
}
apply plugin: 'com.google.gms.google-services'
I want to connect with Firebase but I have an error: "could not parse the android application modules gradle config.resolve gradle build issues and/or resync." and i check my gradle . if i sync gradle i have a warning "WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'."
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "dxd.zzz.axy"
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
implementation 'com.android.support:mediarouter-v7:26.1.0'
implementation files('libs/sqliteassethelper-2.0.1.jar')
}
apply plugin: 'com.google.gms.google-services'
You should write latest version of gms service in app level gradle
Please see the below image
First of all make sure you are using latest google services version (Project Level):
classpath 'com.google.gms:google-services:4.0.1'
Then change your code, you should also add firebase-core like below.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "dxd.zzz.axy"
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.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.android.support:cardview-v7:26.1.0'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
implementation 'com.android.support:mediarouter-v7:26.1.0'
implementation files('libs/sqliteassethelper-2.0.1.jar')
}
apply plugin: 'com.google.gms.google-services'
Moreover, if you want to use other firebase libraries right now please keep up to the latest version like below and always take a look in this link to be sure that you using the latest version.
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-analytics:16.0.0'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-functions:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.0'
implementation 'com.google.firebase:firebase-invites:16.0.0'
implementation 'com.google.firebase:firebase-perf:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-config:16.0.0'
Don't worry about that warning. If it builds successfully then no problem at all.
Please use the latest library for firebase
implementation 'com.google.firebase:firebase-messaging:15.0.0'
And make sure you have to add firebase config file form consol to your project.
Can anyone tell my why dagger2 isn't working for me in Android Studio 3.1 preview?
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.orbitlab.mowerapp"
minSdkVersion 23
targetSdkVersion 26
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
implementation 'com.google.firebase:firebase-database:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation "com.google.firebase:firebase-firestore:11.4.2"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.google.android.gms:play-services-fitness:11.4.2'
implementation 'com.google.android.gms:play-services-auth:11.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
implementation 'com.google.dagger:dagger:2.10'
}
apply plugin: 'com.google.gms.google-services'
This is how my app's build.gradle file looks like. I haven't added anything in the project's build.gradle file.
Can anyone help?
Edit:
The gradle syncs now, but i get dex errors when trying to deploy to my device (havent used Dagger in this project yet).
The error is:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'
Try to update dagger version and check it like this.
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
implementation 'com.google.dagger:dagger:2.10'
You need to add following code to gradle file,
android {
defaultConfig {
multiDexEnabled true
}
}
Then,
1.Clean your project
2.Build the code