I have imported a Phonegap project in Android Studio and I made it a Gradle-based project.
Now I'm trying to compile some external dependencies and I get this error :
Error:(72, 13) Failed to resolve: com.loopj.android:android-async-http:1.4.6 Show in File
Show in Project Structure dialog
I've tried to add those dependencies by going in File-> ProjectStructure-> Dependencies and adding them "automatically". Android Studio do find the libraries and he add them in my build.gradle but I still get the same error...
here is a part of my build.gradle file (the dependencies are at the bottom) :
import java.util.regex.Pattern
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0+'
}
}
ext.multiarch=false
android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
defaultConfig {
versionCode Integer.parseInt("" + getVersionCodeFromManifest() + "0")
}
compileSdkVersion 21
buildToolsVersion "21.0.0"
if (multiarch || System.env.BUILD_MULTIPLE_APKS) {
productFlavors {
armv7 {
versionCode defaultConfig.versionCode + 2
ndk {
abiFilters "armeabi-v7a", ""
}
}
x86 {
versionCode defaultConfig.versionCode + 4
ndk {
abiFilters "x86", ""
}
}
all {
ndk {
abiFilters "all", ""
}
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'org.altbeacon:android-beacon-library:2+@aar'
for (subproject in getProjectList()) {
compile project(subproject)
}
}
thanks for any help :)