Gradle project sync completed with some errors (Cannot sync) - android

I have an error with my build.gradle. I try to link to the Github project but it failed.
build.gradle(Project:XXXX)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//mavenCentral()
maven { url "https://maven/jjhesk" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://maven/jjhesk" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module:XXXX)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.google.testingtimer"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
/* compile fileTree(include: ['*.jar'], dir: 'libs')
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:24.2.1'
compile 'com.github.pheynix:TimerView:660400fb64'
//androidTestCompile 'junit:junit:4.12'
}
I try to follow these instructions which is in this website:
https://github.com/pheynix/TimerView/blob/master/README_ENGLISH.md
https://github.com/Todd-Davies/ProgressWheel
Could someone help me to solve the problem?

I had the same error today. To fix that, I opened build.gradle file and replaced the 2 occurences of:
repositories {
jcenter()
}
By
repositories {
maven { url "http://jcenter.bintray.com" }
jcenter()
}
In my case the problem was caused by the proxy. It has problems with https then I'm forcing the use of http.

Related

Error:Execution failed for task ':app:processDebugResources'. Error: more than one library with package name 'android.support.graphics.drawable'

My android studio is failing to build right now due to the execution failed for task and it says I have more than one library with package name android.support.graphics.drawable. Here is my build.gradle (Project: DemoApp)
// 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.2.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"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle for (Module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.example.rishavsharma.demoapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:28.+'
testCompile 'junit:junit:4.12'
}

Gradle Build fails with new Gradle 3.0.0

I tried starting a new project with the new version 3 of Android Studio. I get this error message:
here is gradle.wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
root.gradle
buildscript {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version'
// 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' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.zabitoglu.myapplication"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.1.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'
}
I tried resolve the issue with the invalidation of cache method, and stopping Gradle daemon, but nothing happen ..

Can not import clarifai api in android

i'm trying to import clarifai api in my android project but it gives the following error :
Error:(28, 13) Failed to resolve: com.clarifai.clarifai-api2:android:2.0.2
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.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "ir.codinglab.objectrecognizer"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
lintConfig rootProject.file('gradle/lint.xml')
}
}
dependencies {
compile 'com.github.markushi:circlebutton:1.1'
compile 'com.clarifai.clarifai-api2:android:2.0.2'
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'
})
testCompile 'junit:junit:4.12'
}
I have to note that i don't have any problems with importing other libraries .
Thank you in advance.
the library you have entered is wrong. This is the correct one -
compile 'com.clarifai.clarifai-api2:core:2.2.3'

issue to add a repository from android arsenal

I am trying to add a PinnedSectionListView from android arsenal.
the way to add say:
Add the specific repository to your build file:
repositories {
maven {
url "https://jitpack.io"
}
}
Add the dependency in your build file (do not forget to specify the correct qualifier, usually 'aar'):
dependencies {
compile 'com.github.beworker:pinned-section-listview:v1.0'
}
so i did that (build.gradle (Project)):
buildscript {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (Module): apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.jonathandg.listviewsections"
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.1.0'
compile 'com.beworker:pinned-section-listview:v1.0#aar'
//compile 'com.beworker:pinned-section-listview:v1.0'
}
then the android studio message is
Error:(25, 13) Failed to resolve: com.beworker:pinned-section-listview:v1.0
The repositoty is in: https://android-arsenal.com/details/1/264
Try below Gragle dependency line
compile 'com.github.beworker:pinned-section-listview:1.1'

Can't install via gradle. Artifact * not found

I already tried the solution (Using ViewPagerIndicator library with Android Studio and Gradle) but not successful. Still got this error message
Error:A problem occurred configuring project ':app'.
> Artifact 'library.aar (com.viewpagerindicator:library:2.4.1)' not found.
Searched in the following locations:
https://repo1.maven.org/maven2/com/viewpagerindicator/library/2.4.1/library-2.4.1.aar
What I trying to do is install this plugin (https://github.com/JakeWharton/ViewPagerIndicator) via gradle. Below is my build.gradle.
apply plugin: 'com.android.application'
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.xxxxx.xxxxx"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.viewpagerindicator:library:2.4.1#aar'
}
Add:
repositories {
maven {
url "https://jitpack.io"
}
}
before mavenCentral()
And to dependencies
compile('com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar') {
exclude module: 'support-v4'
}
I think you can miss this line classpath 'com.android.tools.build:gradle:1.2.3'
My gradle:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.n1to.testapp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
// if you have multiple outputs (when using splits), you may want to have other index than 0
// you should set your package name here if you are using different application IDs
// resourcePackageName "your.package.name"
// You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
}
buildscript {
repositories {
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:1.2.3'
// replace with the current version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
mavenLocal()
}
dependencies {
compile 'org.androidannotations:androidannotations:3.3.1'
apt 'org.androidannotations:androidannotations:3.3.1'
compile 'org.projectlombok:lombok:1.16.4'
compile('com.android.support:appcompat-v7:22.2.0') {
exclude module: 'support-v4'
}
compile('com.android.support:recyclerview-v7:22.2.0') {
exclude module: 'support-v4'
}
compile('com.android.support:cardview-v7:22.2.0') {
exclude module: 'support-v4'
}
compile('com.android.support:design:22.2.0') {
exclude module: 'support-v4'
}
compile 'com.android.support:support-v4:22.1.1'
compile('com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar') {
exclude module: 'support-v4'
}
}

Categories

Resources