dangalg
dangalg

Reputation: 6486

Converted from maven eclipse to android studio can't compile dependencies

For the life of me I am unable to get this to work. I had a Maven project in eclipse. Migrated over to android studio with export-> generate Gradle build files. and imported into android studio. it worked, only any dependency I am trying to add does not work. I read the Gradle manual on importing dependencies. I looked at many examples online but cannot make it work.

this is my build.gradle file:

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.11.+'
}
}
   apply plugin: 'android'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:19.1.0'
compile 'org.eclipse.birt.runtime.3_7_1:org.apache.commons.codec:1.3.0'

}

 android {
compileSdkVersion 19
buildToolsVersion "19.1.0"



buildTypes {

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
signingConfigs {
    debug {
    }
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src\\main\\java','src\\test\\java']
        resources.srcDirs = ['src\\main\\java','src\\test\\java']
        aidl.srcDirs = ['src\\main\\java','src\\test\\java']
        renderscript.srcDirs = ['src\\main\\java','src\\test\\java']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')
}
}

would appreciate any help. If you need more info please ask and I will supply it.

Upvotes: 0

Views: 737

Answers (1)

dangalg
dangalg

Reputation: 6486

Don't know why but adding this bit of code fixed it:

allprojects {
    repositories {
        mavenCentral()
 }
}

Upvotes: 1

Related Questions