i have the following error:
Build gradle file is following:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.bln.smc"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-storage:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'com.android.support:design:23.0.3'
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:recyclerview-v7:23.0.1'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
I researched a little bit and i think that the settings in the gradle file are ok.
So how can i solve this problem?
This is because you have conflicted dependencies in your build.gradle. Firebase UI need version 25 of support library but your dependencies is giving it version 23 instead.
If you want to use firebase-ui:1.2.0, you at least need to use support library version 25.1.1. Take a look at firebase-ui 1.2.0 build.gradle.
Then, you also need to use a compatible Firebase/Google Play Service version. For firebase-ui:1.2.0 you need to use Firebase/Google Play service version 10.2.0.
My suggestion is to use the latest configuration. Something like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.bln.smc"
minSdkVersion 18
targetSdkVersion 26
...
}
...
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
// This is needed for firebase UI
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'
compile 'com.google.firebase:firebase-crash:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.firebaseui:firebase-ui:3.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
Related
I have been developing apps using firebase for over an year now. Today when I open Android Studio suddenly all my projects built on Firebase are throwing the following error:
Error:Could not find firebase-auth-license.aar (com.google.firebase:firebase-auth-license:12.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/firebase/firebase-auth-license/12.0.1/firebase-auth-license-12.0.1.aar
Tried fixing it with many things like updating sdk build tools, google play services etc but still getting same error.
Following is my gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "**********",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
applicationId "*****"
minSdkVersion 19
targetSdkVersion 26
resConfig("en")
versionCode 11
versionName "2.21"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// testCompile 'junit:junit:4.12'
// compile 'com.google.firebase:firebase-ads:9.4.0'
// Single target that includes all FirebaseUI libraries
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile project(':checkbox')
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:support-vector-drawable:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:animated-vector-drawable:26.+'
compile 'com.android.support:customtabs:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.firebaseui:firebase-ui:0.4.4'
compile 'com.squareup.leakcanary:leakcanary-android:1.5'
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.master.android:permissionhelper:1.3'
compile 'com.stone.vega.library:VegaLayoutManager:1.0.2'
compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
}
apply plugin: 'com.google.gms.google-services'
To solve this, please change the following lines of code:
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.firebaseui:firebase-ui:0.4.4'
to
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.4
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-ads:16.0.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
In your top level build.gradle file please be sure to have the latest version of Google Service plugin:
classpath 'com.google.gms:google-services:4.1.0'
The culprit was compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'.
I just replaced it with compile 'com.onesignal:OneSignal:[3.9.1, 3.99.99]' and now everything is fine.
Somehow I have a mistake in my gradle build. Somehow I cannot find the class Bind of butterknife.
It is probably due to my gradle, but I do not know.
I get this error:
Error:(40, 6) error: cannot find symbol class Bind
My grade file looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "de.andreasschrade.androidtemplate"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
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:${android_support_lib_version}"
compile "com.android.support:design:${android_support_lib_version}"
compile "com.android.support:cardview-v7:${android_support_lib_version}"
compile 'com.github.bumptech.glide:glide:3.6.1'
//compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
// api
//compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-moshi:2.3.0'
//compile 'com.android.support:design:25.4.0'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.basgeekball:awesome-validation:2.0'
compile 'com.facebook.stetho:stetho:1.5.0'
compile 'com.facebook.stetho:stetho-okhttp3:1.5.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
testCompile 'junit:junit:4.12'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}
Use #BindView (butterknife:8.6.0) instead of #Bind (butterknife:7.0.1)
The Latest version 8.8.1 should use #BindView instead of #Bind
You need to change minimum sdk version in your gradle file to 15 instead of 14.
defaultConfig {
applicationId "de.mynameis.androidtemplate"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
First, update your version of Jakexharton:Butterknife on latest
compile 'com.jakewharton:butterknife:8.6.0'
to
implementation 'com.jakewharton:butterknife:10.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
And change
#Bind
to
#BindView
compile 'com.google.firebase:firebase-database:10.2.0'
After I added this dependency, the problem occurs. Before that, the GoogleApiClient works fine. I remove that dependency, the problem is solved. Do GoogleApiClient and Firebase have conflict about each other? Please help.
EDIT: Gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "application.id"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.firebase:firebase-database:10.2.0'
}
GoogleApiClient and firebase-database will work, if you add below dependencies,
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
firebase-database dependency will not affect GoogleApiClient
Please keep same versions for firebase & Google Play Services API(10.2.0)
Please re-check you have set up everything as below guidance,
https://firebase.google.com/docs/android/setup
I am new to Android-studio and Firebase.
I am trying to add Firebase UI dependency to my android project and ultimately plan to use FireBase facebook authentication UI.
But I get this message every time I try to sync.
Failed to resolve com.firebaseui:firebase-ui:0.5.3
I checked this link to see the versions but everything looked fine.
This is how my build.gradle looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.rohintak.firebasepractice"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// FirebaseUI Database only
//compile 'com.firebaseui:firebase-ui-database:0.5.3'
// FirebaseUI Auth only
//compile 'com.firebaseui:firebase-ui-auth:0.5.3'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.firebaseui:firebase-ui:0.5.3'
compile 'com.firebase:firebase-client-android:2.3.1'
}
apply plugin: 'com.google.gms.google-services'
You're including different versions of the Firebase SDK and FirebaseUI. That won't work.
Cleaned up dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.firebaseui:firebase-ui-auth:0.5.3'
}
I'm getting that error that says I have too many method references:
Error:The number of method references in a .dex file cannot exceed 64K.
It all started when I tried to change my targetSdkVersion to 24 and minSdkVersion to a lower sdk (19) via the gradle app file. That led me to having to change some values throughout the file like
compile 'com.android.support:appcompat-v7:23.0.0'
to
compile 'com.android.support:appcompat-v7:24.1.1'
I've read that people get this error when they have the wrong values in build.gradle. Here was my original build.gradle before the changes:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.delbridge.seth.alarm"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
Any thoughts as to what's causing this?
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.google.firebase:firebase-ads:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
And here is my build.gradle currently:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.delbridge.seth.alarm"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
}
apply plugin: 'com.google.gms.google-services'
You're unnecessarily including all of Google Play Services with this line:
compile 'com.google.android.gms:play-services:9.4.0'
So, remove that line and leave the ones that include the individual components:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
//remove this line:
//compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
}
Note:
If the above solution does not solve your issue, then you will need to enable multidex.
try this in your build.gradle file:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 14 //lower than 14 doesn't support multidex
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
check this page: https://developers.google.com/android/guides/setup
and use needed google play service