Failed to resolve: com.facebook.android:facebook-android-sdk:4.4.0 - android

Below is code from my build.gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
}
When I do Sync project with gradle files, it gives me error.
Error:(28, 13) Failed to resolve: com.facebook.android:facebook-android-sdk:4.4.0
Can anyone tell me why I'm getting this error?
Similar question has been asked here but no one has answered it. (
Failed to resolve: com.facebook.android:facebook-android-sdk:4.0.0 )

Finally after spending 6-8 hours on it. I got the solution for you. You have to just change repositories section in your app build.gradle file. change it from mavenCentral to jcenter as following
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
After having this, You can simply add the dependency as
compile 'com.facebook.android:facebook-android-sdk:4.0.0'

Try This,
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.4.1'
}
Information
buildToolsVersion "23.0.0 rc3" is not stable purely .Set minSdkVersion 15

Related

Android Studio Failed to resolve:com.github.PhilJay:MPAndroidChart:v2.1.3

Hi all i am using charts library in my project a month ago it was working fine but now i have reinstalled android studio and when i build my project it gives gradle sync error.
Failed to resolve:com.github.PhilJay:MPAndroidChart:v2.1.3
I am stuck on this any suggestions how to solve this.My android studio version is 2.1
Here is project dependencies
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.app.comismv"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
jcenter()
url "https://jitpack.io"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
//compile 'com.cardiomood.android:android-widgets:0.1.1'
}
Thanks in advance
I had the same problem, here is the latest version of MPAndroidChart-v2.2.5.jar jar file.
Just put the MPAndroidChart-v2.2.5.jar inside app/libs/
and add
dependencies {
.
.
compile files('libs/MPAndroidChart-v2.2.5.jar')
}
in gradle file

Could not get unknown property 'compile' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

I was about to add google map activity, and my android studio showed this error
Error:Error:line (25)Could not get unknown property 'compile' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
this is my parse project Gradle file
apply plugin: 'com.android.application'android { compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.parse.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.13.0'
compile 'com.google.android.gms``:play-services:9.2.1'
}
this is my project gradle file
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}}allprojects {
repositories {
mavenCentral()
} } ext {
compileSdkVersion = 23
buildToolsVersion = "23.0.1"
minSdkVersion = 14
targetSdkVersion = 23 }
Just Change your line breaks , it will solve your problem
dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.13.0'
compile 'com.google.android.gms:play-services:9.2.1'
}
break line after each dependencies.
See answer here : https://stackoverflow.com/a/33991915/4985413
I got this error when I used the automatic creation of Activity in Studio. Apparently, studio tried to add ConstraintLayout dependency to my build.gradle file and this messed up my build.gradle file.
If this is the case, just use your version control and see what's messed up and correct it.
No commas between separate line items, it's not JSON

Failed to resolve: com.github.moondroid.coverflow:library:1.0

CoverFlow is pushed to Maven Central as a AAR, so you just need to add the it's dependency to local build.gradle (usually locate in app module). Because of this libary is build in the min-sdk is 15, so your project must set same as it:
but when I try to use this library I got this error
Failed to resolve: com.github.moondroid.coverflow:library:1.0
this is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.maysara.theproject"
minSdkVersion 16
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.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.github.moondroid.coverflow:library:1.0'
compile 'com.android.support:cardview-v7:23.0.1'
}
Add to your graldle file:
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
At first set minSdkVersion 15 instead of 16
Whats your Logcat says
so you just need to add the it's dependency to local build.gradle
(usually locate in app module). Because of this libary is build in the
min-sdk is 15, so your project must set same as it:
defaultConfig {
applicationId "com.example.maysara.theproject"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
FYI
Enable publishing AAR file to Maven Central
repositories {
jcenter() // or mavenCentral()
}

Unable to use amlcurran.showcaseview library in android studio

I am trying to use amlcurran/showcaseview library and i am following this tutorial, but i am unable tor resolve the library:
Error:(29, 13) Failed to resolve: com.github.amlcurran.showcaseview:library:5.0.0
Here is my build.gradle(project) file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.wolverine.showcasetutorial"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "http://jcenter.bintray.com" }
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.github.amlcurran.showcaseview:library:5.0.0'
}
Please help me to fix this.
add this your manifest file
<uses-sdk tools:overrideLibrary="com.github.amlcurran.showcaseview"/>

Android Studio Gradle build failing when trying to include local library

The error I am getting is:
Gradle 'MyProject' project refresh failed:
Project with path 'libraries:mylibrary_sdk' could not be found in project':myproject'
This is my settings gradle
include ':libraries:mylibrary_sdk',':myproject'
Top level build gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
myproject build gradle
apply plugin: 'android'
dependencies {
compile 'com.android.support:support-v4:19.0.1'
compile project ("libraries:mylibrary_sdk")
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}
mylibrary_sdk build gradle
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
I have read over all the similar answers but I am still stuck on this issue. If I remove compile project ("libraries:mylibrary_sdk") and the libraries:mylibrary_sdk include then myproject builds fine, just without access to mylibrary. The libraries folder is at the same level as settings.gradle, the top level build.gradle and the folder with myproject.
Any help would be appreciated.
This works, adding in answer..it might help someone later
dependencies { compile 'com.android.support:support-v4:19.0.1' compile project (":libraries:mylibrary_sdk") }

Categories

Resources