Whenever I add a dependency from an remote repository (jcenter) in Android Studio 1.1 (OS X) I get the following error upon syncing Gradle:
Error:(26, 13) Failed to resolve: <packagename:version>
My app's build.gradle is as follows: apply plugin: 'com.android.application'
android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "nl.timmevandermeer.cargoapp" minSdkVersion 19 targetSdkVersion 21 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:21.0.3' compile 'com.android.support:support-v4:21.0.3' compile 'com.google.android.gms:play-services:6.5.87' compile 'org.json:json:20141113' }
I have tried changing repositories (jcenter(), mavenCentral(), etc.), reinstalling Android Studio, JDK (7 and 8), changing Gradle version and Android SDK version, none of which worked. Upon running ./gradlew build I get:
Could not resolve com.android.tools.build:gradle:1.1.0. 13:48:04.914 [ERROR] [org.gradle.BuildExceptionReporter] Required by: 13:48:04.915 [ERROR] [org.gradle.BuildExceptionReporter] :CargoApp:unspecified 13:48:04.932 [ERROR] [org.gradle.BuildExceptionReporter] > org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
This is an error I get in other cases as well, for example when trying to use Intellij Idea instead of Android Studio. Running the app without the dependency does work though.
A similar problem here, and when I choose Build -> Clean Project there is a "peer not authenticated" error.
solved by using "http://jcenter.bintray.com/" instead of "https://jcenter.bintray.com/"
repositories { jcenter({url "http://jcenter.bintray.com/"}) }
hope this work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With