I'm trying to include Firebase Authentication in my Android app, but when I compile my program I get the error
Program type already present: com.google.android.gms.auth.api.signin.internal.zzp
Changing the version from 11.8.0 to 11.2.2 worked, but I need to use Firestore, which only has 11.8.0, and the two are incompatible. Here's my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.my.app"
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.google.firebase:firebase-auth:11.8.0'
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.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
Is there a conflicting file I need to delete?
You need to change this:
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
to this:
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
Also there is no firebase 11.2.2, I think you meant 11.4.2 which is compatible with the above firebase ui version.
The firebase version 11.8.0 is compatible with firebaseui 3.2.1
You can check this table here: https://github.com/firebase/FirebaseUI-Android#compatibility-with-firebase--google-play-services-libraries
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'
This question already has answers here:
Dependancy error when integrating android studio project with Firebase for a google sign in feature
(4 answers)
Closed 3 years ago.
I force to add firebase authentication to my app, but I take this error :
Failed firebase auth 15.0.0
It says in the solutions on the internet: If you delete part 15.0.0 will be corrected
but when :15.0.0 part is deleted,it say the authentication feature is not added.
What can I do?
My build is here:
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.ppd.ment"
minSdkVersion 19
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'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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-analytics:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
}
Try this one:
implementation 'com.google.firebase:firebase-auth:16.0.5'
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'
This is my dependencies file and there is an underlined red colored text on the compile 'com.android.support:appcompat-v7.27.1.1'
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.abc.mcaproject"
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7.27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-messaging:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-storage:11.6.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'
This because of this I am having problems changing themes in the styles.xml
when you hover over the red line it may show you the image like this which I have attached below.
What it tells you is there is a conflict of the version in some libraries so it suggests us to add those. For my case first, it showed for CardView and then for Design. So I added to it. Below is the code for it.
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.0'
implementation 'com.payumoney.sdkui:plug-n-play:1.2.0'
implementation 'com.android.support:cardview-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'
}
so kindly add those it may be 2 or more than that.
Hope that helps.
In Android Studio 3.0 ,the compile configuration is now deprecated and should be replaced by implementation or api.
Just replace:
implementation 'com.android.support:appcompat-v7.27.1.1'
compile with implementation
testCompile with testImplementation.
debugCompile with debugImplementation.
androidTestCompile with androidTestImplementation.
compileOnly is still valid. It was added in 3.0 to replace provided and not compile.
for more information read this gradel doc
Reason of fail
You are using incompatible version of firebase with 27.1.1 support version.
Current version > 16.0.0 and you use 11.6.0.
Solution
Update your firebase dependencies versions. I suggest update target sdk version also.
Below is updated gradle as of date 1-10-2018, you can see firebase page to check latest version.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.abc.mcaproject"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
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'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-database:16.0.2'
implementation 'com.google.firebase:firebase-messaging:17.3.2'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.2'
}
apply plugin: 'com.google.gms.google-services'
Suggestion
Migrate to androidx because Android will not update support libraries after version 28.0.0.
just goto-> files->project structures->app->flavors
change your min SDK version and target SDK version to "API 27:"
then go to properties and check that your compile SDK version has also changed to the above version which you selected.
This worked for me.
I am facing an issue with android studio 3.0.1, when I try to build the gradle project I have this message "Could not find method implementationSDKVersion()"
my gradle version is 4.1 and android plugin version is 3.0.1
here is my complete build.gradle file
apply plugin: 'com.android.application'
android {
implementationSdkVersion 26 //error on this line
defaultConfig {
applicationId "com.anatech.evidencereporter"
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.4.2'
implementation 'com.google.firebase:firebase-database:11.4.2'
implementation 'com.google.firebase:firebase-storage:11.4.2'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.firebaseui:firebase-ui-database:3.1.0'
implementation 'com.google.android.gms:play-services-places:11.4.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
any suggestions?
The problem is in implementationSdkVersion which should be compileSdkVersion. It happens when you are replacing automatically and blindly all the words "compile" with the word "implementation", without a "words" checkbox in the replacement options toolbar, due to gradle update. compile is deprecated for a future use but compileSdkVersion is not. Just had this issue.