I am using glide and firebase to manage my upload and download image to show a user profile pic, i follow the github repo where it talks about the firebaseUI and the glide, at the begin when my project worked fine my app gradle was like that:
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.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:design:25.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
testCompile 'junit:junit:4.12'
after reading the docs where it says that if i want to include the firebaseUI version i need to upgrade all the compiles related to firebase to 10.2.0, i did this:
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.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
testCompile 'junit:junit:4.12'
}
but i keep getting a error on my first compile: compile 'com.android.support:appcompat-v7:25.2.0'
the error is the following:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.2.0, 25.1.1. Examples include com.android.support:animated-vector-drawable:25.2.0 and com.android.support:cardview-v7:25.1.
my project gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
need some help here im confused about this error :S
first, this is not relevant with Glide library.
gradle says "this project has different versions of android support packages", so you must use all com.android.support packages with same version. for example your project has '25.2.0' and '25.1.1'.
How can I achieve this ? Put this block to app level build.gradle
android {
...
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.2.0'
}
}
}
}
dependencies {
...
}
you can say "But I just compile my all android support packages with same level which is 25.2.0". some libraries includes android support packages and 25.1.1 is coming from your dependency.
Related
I was adding firebase to my project as documented in the official website.
In the 4th step it says to add compile 'com.google.firebase:firebase-core:16.0.0'.
But trying to synch gradle I would get errors:
and by trying to download them (install repository abd synch project) I would get this error:
here is my gradle dependencies:
dependencies {
implementation 'com.google.firebase:firebase-core:16.0.1'
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.google.android.gms:play-services-gcm:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.google.firebase:firebase-auth:11.6.2'
compile 'com.google.android.gms:play-services-auth:15.0.1'
compile 'com.google.code.gson:gson:2.7'
compile('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
compile 'com.onesignal:OneSignal:3.6.5'
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
}
this answer did not work either:
this
update
My project-level gradle:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenCentral()
google()
}
}
Upgrade the following:
implementation 'com.google.firebase:firebase-auth:11.6.2'
into this:
implementation 'com.google.firebase:firebase-auth:16.0.2'
Add google service plugin version 4.0.1 and google() repo in top level gradle file:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
Use same versions of firebase services to avoid conflicts.
Refer https://firebase.google.com/docs/android/setup
To solve your problem.
Before you proceed, clean and rebuild your project.
Then at app/build.gradle,
add apply plugin: 'com.google.gms.google-services'
like the code snippet down below.
android {
// ...
}
dependencies {
// ...
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
And make sure all the library used are as here.
Hope it helps!
Add firebase-core to your dependencies block:
implementation 'com.google.firebase:firebase-core:16.0.1'
The Firebase SDK release notes for the June 12 release explain:
Your app gradle file now has to explicitly list
com.google.firebase:firebase-core as a dependency for Firebase
services to work as expected.
It's also safer to list google() first in repository lists:
repositories {
google()
jcenter()
...
}
While generating a signed apk I am experiencing this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v13/view/DragAndDropPermissionsCompat.class
One of the reference link said to update the dependencies so I did but still no help.
My gradle dependencies looks like:
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:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.android.gms:play-services-auth:11.6.0'
compile 'com.google.android.gms:play-services-places:11.6.0'
compile 'com.google.android.gms:play-services-ads:11.6.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'agency.tango.android:material-intro-screen:0.0.4'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.afollestad.material-dialogs:core:0.8.6.1'
compile 'com.afollestad.material-dialogs:commons:0.8.6.1'
compile 'com.tumblr:remember:1.0.0#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.wang.avi:library:2.1.3'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.wdullaer:materialdatetimepicker:3.5.1'
compile 'com.shawnlin:number-picker:2.4.5'
compile 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.2.0'
compile 'com.kofigyan.stateprogressbar:stateprogressbar:0.0.8'
compile 'com.github.jhonnyx2012:horizontal-picker:1.0.6'
compile 'com.zhihu.android:matisse:0.4.3'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
//debugCompile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
testCompile 'junit:junit:4.12'
compile("com.github.hotchemi:permissionsdispatcher:3.2.0") {
// if you don't use android.app.Fragment you can exclude support for them
exclude module: "support-v13"
}
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:3.2.0"
}
and at my project level gradle I am doing this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven { url "https://maven.google.com" }
}
}
I did not find any help on internet other than this link but still no progress.
This answer solved it. And this article helped to resolve the error.
Update your project level build.gralde to use newer gradle tools:
classpath 'com.android.tools.build:gradle:3.1.2' // or even newer
and remove this:
classpath 'com.google.gms:google-services:3.1.0'
lastly update your buildToolsVersion to 26.0.3
exit Android studio, clean, rebuild :)
I'm getting this message in android studio:
Failed to resolve: com.google.android.gms:play-services-appindexing:11.0.0...
What do I have to do?
My Gradle: app-
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.3.1'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'com.google.android.gms:play-services-appindexing:11.0.0'
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-core:11.0.1'
testCompile 'junit:junit:4.12'
apply plugin: 'com.google.gms.google-services'
I've recived this message from the start.
Thank you so much.
Try update or install Google Repository
Tools -> SDK Manager -> Google Repository
Have you added google maven repo?
repositories {
// google before jcenter to avoid mailicious artifacts
maven { url 'https://maven.google.com' } // or simple google() on gradle 4.0+
jcenter()
...
}
I am building a android application with gradle in Android Studio, and i have a dependency jackson-databind, but i get a error can't resolve xxx, even i use my private repo and i sure that library is there.
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
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:recyclerview-v7:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.8.1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.1'
testCompile 'junit:junit:4.12'
}
And i get a error.
I update my gradle to 3.2 and it work well.
Sounds like you may just need to sync your build.gradle file, click the "Sync Now" like in this image here: https://postimg.org/image/v0yro39cl/
Im new for android, I want to add payment option in my app. So, I used instamojo. Im include instamojo library in gradle file. But gradle file throw error.
Error:
Error:Failed to resolve: in.juspay:godel:0.6.11.0823
My gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.2.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.loopj.android:android-async-http:1.4.7'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile 'com.android.support:multidex:1.0.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.instamojo:android-sdk:1.2.4'
}
If i run the instamojo sdk in separate application means working perfectly.If i integrate with my app means getting above gradle error.
Please, anyone help to resolve.
Thanks in advance.
Error:Failed to resolve: in.juspay:godel:0.6.11.0823
From here or here
You should have an allprojects block, that contains some lines like this
// Add to build.gradle
repositories {
jcenter() // <-- should already be there
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
And in app/build.gradle
dependencies {
// compile 'in.juspay:godel:0.6.12.0823' // maybe need this?
compile 'com.instamojo:android-sdk:1.2.4'
// your other dependencies
...
...
}
Also, this line needs not to be there. compile 'com.google.gms:google-services:3.0.0' It should be in the classpath of the buildscript dependencies block.
And 'com.android.support:design:23.1.1' should use 23.2.0 to match the other Android support versions.
Regarding "Manifest merger failed", you can search to find something similar, and start with removing this line, because it's redundant with the other dependencies.
compile 'com.android.support:support-v4:23.2.0'
// Add to build.gradle
repositories {
jcenter() // <-- should already be there
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
then add this in your manifest file
<meta-data android:name="instamojo.orderauth.url"
android:value="ur website name/access_token.php"
/>