Failed to resolve Android Giphy SDK dependency - android

I am trying to add Giphy Android SDK in my Android Project. On Giphy SDK's documentation, it is mentioned that in your Project gradle.build file, add:
repositories {
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
and in your module's gradle.build file add:
compile('com.giphy.sdk:core:1.0.0#aar') {
transitive=true
}
But when i am Syncing it, Android Studio is giving me an error saying:
Failed to resolve: com.giphy.sdk:core:1.0.0
Does anyone have any idea what am i missing?

Make sure to add the following line
repositories {
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
under allprojects and not under buildscript like so
allprojects {
repositories {
google()
jcenter()
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
}

Related

ERROR: Failed to resolve: com.android.support:support-v4:23.3.0

enter image description hereAn error with Gradle in android studio.
It says: ERROR: Failed to resolve: com.android.support:support-v4:23.3.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.android.support:design:23.3.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app
Add maven in your build.gradel file
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
Sync code again.
The support libraries are now available through Google's Maven repository.
Step 1: Open the build.gradle file of your project.
Step 2: Make sure that the repositories section includes a maven section with the https://maven.google.com url in it.
allprojects {
repositories {
google() // here
jcenter()
maven { url 'https://maven.google.com' }
}
}
Step 3: Add the support library to the dependencies section. For example, to add the v4 core-utils library, add the following lines:
dependencies {
...
implementation"com.android.support:support-core-utils:23.0.0"
}
In build.gradle you have to add:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
Kotlin-DSL version:
allprojects {
repositories {
jcenter()
maven(url= "https://maven.google.com")
}
}

Conflict between allprojects repository setting and Fabric

I had an issue with gradle thinking I wanted multidex 1.0.2 so I setup the repository in the top level build file and moved it out of the buildscript (as per: Android Studio 3.0 Beta 1: Failed to resolve: com.android.support:multidex:1.0.2):
allprojects {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
}
However, Fabric seems to dislike this. In the buildscript sections of my project (and library) I have:
buildscript {
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
And now I get:
Error:Could not find any matches for io.fabric.tools:gradle:1.+ as no versions of io.fabric.tools:gradle are available.
Searched in the following locations:
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/io/fabric/tools/gradle/maven-metadata.xml
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/io/fabric/tools/gradle/
https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml
https://jcenter.bintray.com/io/fabric/tools/gradle/
Required by:
project :
How can I resolve this conflict? How to I specify to fabric, if not in all projects, where to get its own dependencies?
Error:Could not find any matches for io.fabric.tools:gradle:1.+ as no versions of io.fabric.tools:gradle are available.
It happens since gradle is looking for the plugin only in the jcenter repo.
To setup fabric you have to use it:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
It is required by the gradle plugin.
Then you have to add:
repositories {
maven { url 'https://maven.fabric.io/public' }
}
It is used by the dependencies added in the projects.
A colleague managed to resolve it with the following declaration in the app's build.gradle file:
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}

Gradle error : Could not find com.android.tools.build:gradle:2.2.3

I'm trying to build my android project using gradle and circleCI, but I've got this error :
* What went wrong:
A problem occurred configuring root project '<myproject>'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
:<myproject>:unspecified
Can someone explain me why I've got this problem please?
It seems the current versions of the Android Gradle plugin are not added to Maven Central, but they are present on jcenter. Add jcenter() to your list of repositories and Gradle should find version 2.2.3. On Maven Central the newest available version is 2.1.3: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.android.tools.build%22%20AND%20a%3A%22gradle%22. You can also complain to the authors that the current versions are missing on Maven Central.
Reading sembozdemir answer in this post I have resolved a similar problem adding jcenter() in build.gradle (module: cordovaLib)
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
After the recent update to Android Studio 3.0 Canary 1, I got the following error:
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.0-alpha1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.jar
Required by:
project :
Here is what I had to add (to the project-level build.gradle):
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
....
}
Found here: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html
i had the same issue when i update my android studio to 3.0 then its solved by adding
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
from https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#update_gradle
On my side I got the same issue because I used the wrong order of repositories.
google() should be added before jcenter()
buildscript {
repositories {
google()
jcenter()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
Just change the mavenCentral() to jcenter()
Do you try it
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
flatDir {
dirs 'libs'
}
}
}
and
Build->Clear Project
Try this:
allprojects {
buildscript {
repositories {
maven {
url "https://dl.bintray.com/android/android-tools"
}
}
}
...
}
Updating CordovaLib -> build.gradle also worked for me, as above. I was looking at the root build.gradle initially which was correct and already included jcenter().
Only go to the following path and delete the caches folder completely then rebuild the project:
C:\Users\[Your User Name]\.gradle
Change the gradle version as same to android version like Right know we are using 2.3.2 of gradle
Add jcenter in your project gradle file and sync
The issue is caused by your type of internet connection which prevents or blocks Android Studio from downloading required files from jcenter, this should happen automatically when you build your solution. The solution to your problem is to connect to internet using your personal internet connection such as ADSL Router, rebuild the project and the download of necessary files will happen automatically.

Error: Failed to resolve: com.esri.arcgis.android:arcgis-android:10.2.6-2

I followed this guide to add an ArcGIS map to my app, but it doesn't work. I get the following error:
Error: Failed to resolve: com.esri.arcgis.android:arcgis-android:10.2.6-2
What am I doing wrong?
From your screenshots, you put your maven block in the wrong place. You put it under buildscript -> repositories, but according to https://developers.arcgis.com/android/guide/install-and-set-up.htm it should be under allprojects -> repositories:
allprojects {
repositories {
jcenter()
// add the esri arcgis maven repo
maven {
url 'http://dl.bintray.com/esri/arcgis'
}
}
}
The way you did it in your screenshot would cause the error you see.
As of 2021, the URL has been changed to https://esri.jfrog.io/artifactory/arcgis according to this announcement. So now you have to do it like this.
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://esri.jfrog.io/artifactory/arcgis'
}
}
}

Trying to add mp4parser in my project android studio

I have been trying to integrate mp4parser library
by adding
compile 'com.googlecode.mp4parser:isoparser:1.0.5.4'
But it gives me error
Error:(24, 13) Failed to resolve: com.googlecode.mp4parser:isoparser:1.0.5.4
Without your build.gradle I'm speculating here, but I think that you are missing:
repositories {
mavencentral()
}
in you main build.gradle file.
In my I have the following
allprojects {
buildscript {
repositories {
mavenCentral()
maven {
url "http://repository-monochromeroad.forge.cloudbees.com/release/"
}
}
}
repositories {
mavenCentral()
}
}
The second repositories {} block is essential.

Categories

Resources