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

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()
}

Related

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

Unable to sync gradle

I get error messages when I try to add recyclerview and cardview dependencies to my build.gradle. Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.truewebdev.applytheme"
minSdkVersion 17
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.2.0'
compile 'com.android.support.recyclerview-v7:23.2.0'
compile 'com.android.support.cardview-v7:23.2.0'
}
Here are the error messages:
If I try to install repository, I get the following:
What is wrong here?
Did you download the Android Support Repository from the SDK Manager?
From android docs:
Make sure you have downloaded the Android Support Repository using the SDK Manager.
http://developer.android.com/tools/support-library/setup.html#libs-with-res

Cannot Update buildtool version from build.gradle

I was trying to update build tool version from build.gradle and got this Gradle Sync Error message
:- I juset went to build.gradle file inside the app directory and changed the:
buildToolsVersion '20.0.1' to buildToolsVersion '23.0.0' and then everything went wrong.
so I looked at the SDK manager but the build tool is installed there
What should I do now?
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.android.didyoufeelit"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
repositories {
mavenLocal()
mavenCentral()
google()
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:27.1.1'
}
try to update this into the build.gradle

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") }

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

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

Categories

Resources