Gradle project refresh failed with no error details - android

I was working on a project and updated the Android Studio to 1.5 beta. Also I installed android sdks 22 and 23 via SDK manager. After restart the Gradle is failing to refresh without giving any error details.
Here is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.company.projname"
minSdkVersion 14
targetSdkVersion 22
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:22.0.3'
compile 'com.android.support:cardview-v7:22.0.2'
compile 'com.android.support:design:22.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.sothree.slidinguppanel:library:3.2.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.google.code.gson:gson:2.3.1'
}
Whats wrong with this?
Edit: Android Studio Version details
Thanks.

Related

How to solve "gradle failed resolve"?

Can't compile it and can't see in my library.
Error
gradle failed resolve `com.theartofdev.edmodo:android-image-cropper:+” Compilation fails.
build.gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.backuppc.breathanalyzer"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
The dependencies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.theartofdev.edmodo:android-image-cropper:+'
}
Please replace the
compile 'com.theartofdev.edmodo:android-image-cropper:+'
with the latest version
compile 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
Please make sure the dependency is of latest version. You can get the latest version here:
https://bintray.com/package/files/arthurhub/maven/Android-Image-Cropper?order=asc&sort=name&basePath=com%2Ftheartofdev%2Fedmodo%2Fandroid-image-cropper&tab=files
Hope this helps..

Error when updating google play services GCM

I'm attempting to update the play services GCM, by changing the following line:
compile 'com.google.android.gms:play-services-gcm:9.2.1'
to:
compile 'com.google.android.gms:play-services-gcm:12.0.0'
I then get the message "Install repository and sync project". When I do this, I get the dialog "Finding Available SDK Components", and a little while after another message popup:
"Could not find dependency "com.google.android.gms:play-services-gcm:12.0.0"
My full build.gradle file, if it helps, is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.myapp"
minSdkVersion 18
targetSdkVersion 26
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.4.0'
compile 'com.google.android.gms:play-services-gcm:12.0.0'
compile 'net.danlew:android.joda:2.9.3.1'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.okio:okio:1.8.0'
}

Failed to resolved: compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'

apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "org.passitonkentucky.fayetteresources"
minSdkVersion 18
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.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.android.support:multidex:1.0.2'
}
I downloaded Android 3.0.1, before this I had error minimum version 3.0.
When that's resolved, it's now showing me error.
(27,4).
How can I solve this problem?
First you should avoid using "+" in version number its bad practice. add version number will solve your problem.
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'

Android studio getting crashed when gradle is build on mac

I am working on android studio from one year But i can't face this type of problem. What i am doing is adding a dependency of support library in app build.gradle and then sync the project.
Gradle build running is started in background and then after some time studio is automatically crashed. There is no error or logs are found for crashes. And if I removed the dependency from gradle it works properly. I also restarted the machine and having an latest update of studio but it can't fixed the problem. Thanks in advance for any help.
Here is my app level build.gradle file. I am adding compile 'com.android.support:design:22.2.0' library in my project
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId ""
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'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.android.gms:play-services-base:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.isseiaoki:simplecropview:1.0.9'
compile "com.mixpanel.android:mixpanel-android:4.8.0"
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.10.1'
}
apply plugin: 'com.google.gms.google-services'

Issue in Compiling gradle File

It is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.0 rc2'
defaultConfig {
applicationId "com.nanu.admin.notification"
minSdkVersion 8
targetSdkVersion 22
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.1'
compile 'com.android.support:design:23.1.1'
}
the last two lines showing errors ..how can I solve that in android studio???
Thats because your build version of the project and support version are different change the support library versions
the problem is here
buildToolsVersion '23.0.0 rc2'
Solution : 1
replace builtToolsVersion with 23.0.1 or 23.0.2
Solution : 2
replace
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
with
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
or
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
Since you are using the support libraries v23, you have to compile with api 23.
Change this line :
compileSdkVersion 23
Also change the buildToolsVersion with the latest stable release.
buildToolsVersion '23.0.2'

Categories

Resources