java - Android Studio gradle build cannot add dependencies on old build gradle file -


i have imported old gradle project adt android studio. sdk, repository .. updated. how ever can't add dependencies project. says not find. if create new project, fine. here gradle build file:

buildscript {     repositories {         jcenter()         mavencentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.2.3'     } } android {     buildtoolsversion "19.1.0"     compilesdkversion 19      defaultconfig {         minsdkversion 14         targetsdkversion 21         multidexenabled true     }     dexoptions {         predexlibraries = false         javamaxheapsize '2g'     }     sourcesets {         main {             manifest.srcfile 'androidmanifest.xml'             java.srcdirs = ['src']             aidl.srcdirs = ['src']             renderscript.srcdirs = ['src']             res.srcdirs = ['res']             assets.srcdirs = ['assets']         }          instrumenttest.setroot('tests')     }     compileoptions {         encoding "utf-8"         sourcecompatibility javaversion.version_1_7         targetcompatibility javaversion.version_1_7     } } dependencies {     compile 'com.android.support:multidex:1.0.1'     compile 'com.android.support:support-v4:22.0.0'     compile project(':core')     compile 'org.slf4j:slf4j-android:1.7.7'     compile 'com.google.android.gms:play-services:+'     compile files('libs/app42multiplayergamingsdk.jar')     compile files('libs/google-play-services.jar')     compile project(':facebook')     //compile('com.android.support:appcompat-v7:21.0.3') } // needed add jni shared libraries apk when compiling on cli tasks.withtype(com.android.build.gradle.tasks.packageapplication) { pkgtask ->     pkgtask.jnifolders = new hashset<file>()     pkgtask.jnifolders.add(new file(projectdir, 'libs')) }  // called every time gradle gets executed, takes native dependencies of // natives configuration, , extracts them proper libs/ folders // packed apk. task copyandroidnatives() {      file("libs/armeabi/").mkdirs();     file("libs/armeabi-v7a/").mkdirs();     file("libs/x86/").mkdirs();      configurations.natives.files.each { jar ->         def outputdir = null         if(jar.name.endswith("natives-armeabi-v7a.jar")) outputdir = file("libs/armeabi-v7a")         if(jar.name.endswith("natives-armeabi.jar")) outputdir = file("libs/armeabi")         if(jar.name.endswith("natives-x86.jar")) outputdir = file("libs/x86")         if(outputdir != null) {             copy {                 ziptree(jar)                 outputdir                 include "*.so"             }         }     } }  task run(type: exec) {     def path     def localproperties = project.file("../local.properties")     if (localproperties.exists()) {         properties properties = new properties()         localproperties.withinputstream { instr ->             properties.load(instr)         }         def sdkdir = properties.getproperty('sdk.dir')         if (sdkdir) {             path = sdkdir         } else {             path = "$system.env.android_home"         }     } else {         path = "$system.env.android_home"     }      def adb = path + "/platform-tools/adb"     commandline "$adb", 'shell', 'am', 'start', '-n', 'jangkoo.game.shadowfiend.android/jangkoo.game.shadowfiend.android.androidlauncher' }  // sets android eclipse project, using old ant based build. eclipse {     // need specify java source sets explicitely, springsource gradle eclipse plugin     // ignores nodes added in classpath.file.withxml     sourcesets {         main {             java.srcdirs "src", 'gen'         }     }      jdt {         sourcecompatibility = 1.6         targetcompatibility = 1.6     }      classpath {         plusconfigurations += project.configurations.compile                 containers 'com.android.ide.eclipse.adt.android_framework', 'com.android.ide.eclipse.adt.libraries'            }      project {         name = appname + "-android"         natures 'com.android.ide.eclipse.adt.androidnature'         buildcommands.clear();         buildcommand "com.android.ide.eclipse.adt.resourcemanagerbuilder"         buildcommand "com.android.ide.eclipse.adt.precompilerbuilder"         buildcommand "org.eclipse.jdt.core.javabuilder"         buildcommand "com.android.ide.eclipse.adt.apkbuilder"     } }  // sets android idea project, using old ant based build. idea {     module {         sourcedirs += file("src");         scopes = [ compile: [plus:[project.configurations.compile]]]                  iml {             withxml {                 def node = it.asnode()                 def builder = nodebuilder.newinstance();                 builder.current = node;                 builder.component(name: "facetmanager") {                     facet(type: "android", name: "android") {                         configuration {                             option(name: "update_property_files", value:"true")                         }                     }                 }             }         }     } } 

i have searched few days, couldn't find out how use. can tell me where's wrong gradle file? it's libgdx build. solution on this? can add jar file not google libraries.

i solved problem getting nightly builds of libgdx, create new project , copy source old project. import android libraries android studio. think it's because of new gradle version.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -