I'm trying to sync project with Gradle. But gradle gives some error.
The error code like this : Error:A problem occurred configuring project ':app'.
Could not find support-annotations.jar (com.android.support:support-annotations:24.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-annotations/24.0.0/support-annotations-24.0.0.jar
My build.gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.example.ileem.tiiu"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0-alpha2'
compile 'com.android.support:design:24.0.0-alpha2'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.google.firebase:firebase-messaging:9.6.1'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile files('libs/gson-2.2.4.jar')
compile files('libs/jsoup-1.10.1.jar')
}
apply plugin: 'com.google.gms.google-services'
Try upgrading to the latest version of the build tools and support libraries. You can find them here.
Related
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..
Android studio shows possible causes:
The project may be using a version of Gradle that does not contain the method.The build file may be missing a Gradle plugin.
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 17
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.android.application"
manifestPlaceholders = [manifestApplicationId: "${com.android.application}",
onesignal_app_id:"3z281386-18df-4ae8-95fb-da47db595f27",
onesignal_google_project_number:"570040958475"]
minSdkVersion 22
targetSdkVersion 22
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.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0' }
You need to add
apply plugin: 'com.android.application'
As the first line of the build.gradle
All the while my apps running smoothly with this build.gradle file.
Then, I need to display TreeView so I have to use third party library from bmelnychuk/AndroidTreeView.
When I add compile 'com.github.bmelnychuk:atv:1.2.+'into the build.gradle file, it showed this error:
Error:A problem occurred configuring project ':app'.
Could not find appcompat-v7.jar (com.android.support:appcompat-v7:24.1.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/24.1.1/appcompat-v7-24.1.1.jar
This is the gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.ada.foresight"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
// Enabled multidex support
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.prolificinteractive:material-calendarview:1.4.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
compile 'com.android.support:percent:22.2.0'
compile 'com.github.satyan:sugar:1.4'
// problem occur while I added this line:
//compile 'com.github.bmelnychuk:atv:1.2.+'
}
Please help.
I get the following exception when I tried to run my project on a device with Kitkat O.S. I am not sure what this error is.It workes perfectly on lollipop device.
Exception:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/Request$Priority.class
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.stackoverflow.application"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
apply plugin: 'maven'
}
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile project(':payUMoneysdk')
}
It looks like you already have volley library in one of your dependencies.
Remove the following line from your build.gradle.
compile 'com.android.volley:volley:1.0.0'
I keep getting the BUILD FAILED in Android studio and I have resolved other similar error before but this one is hard. Basically what i do is adding the quickstart-android-auth to an existing working Android project.
Everything worked until i adding the quickstart-android-auth files and independents.
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library
[com.facebook.android:facebook-android-sdk:4.16.0]
D:\AndroidStudioProjects\Nogget\app\build\intermediates\exploded-aar\com.facebook.android\facebook-android-sdk\4.16.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.facebook" to force usage
And here is my Build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.2'
dexOptions {
dexInProcess = true
}
defaultConfig {
applicationId "com.port.android"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
packagingOptions{
exclude 'META-INF/LICENSE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:support-compat:24.2.0'
compile 'com.google.android.gms:play-services:9.6.0'
compile 'com.android.support:support-v13:24.2.0'
compile "com.google.firebase:firebase-messaging:9.0.0"
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:design:24.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:percent:24.2.0'
compile 'me.grantland:autofittextview:0.2.+'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
compile 'com.google.android.gms:play-services-appinvite:9.6.0'
compile 'com.google.firebase:firebase-analytics:9.2.1'
compile 'com.google.firebase:firebase-crash:9.6.0'
compile 'com.google.android.gms:play-services-ads:9.6.0'
compile 'com.github.bmelnychuk:atv:1.2.+'
compile 'com.github.johnkil.print:print:1.2.2'
testCompile 'junit:junit:4.12'
compile 'com.seatgeek:placesautocomplete:0.2-SNAPSHOT'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
compile 'com.facebook.android:facebook-android-sdk:4.16.0'
compile('com.twitter.sdk.android:twitter-core:1.6.6#aar') {
transitive = true
}
compile('com.twitter.sdk.android:twitter:1.13.1#aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'
As the error says, your minSDK is 14 but the latest FacebookSDK requires mins SDK 15. Increasing your minSDK should resolve your issue
Change your minSdkVersion to 15 instead of 14.
The Facebook library require api 15. So your project can't have a minsdkversion to 14...
Set the minSdk in your build.gradle to 15 as facebook supports from API 15.