No signature of method (or how to add a third-party library) in Android Studio -


i have android studio 0.5.8. here build.gradle file:

buildscript {     repositories {         mavencentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:0.9.+'      }  }  allprojects {     repositories {         mavencentral()     }    dependencies {     compile files('libs/scala-compiler.jar', 'libs/scala-library.jar', 'libs/scala-reflect.jar')   } } 

i added libs manually because right-mouse-click on *.jar didn't cause add line compile files. i'm getting error now:

error: no signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler.compile() applicable argument types: (org.gradle.api.internal.file.collections.defaultconfigurablefilecollection) values: [file collection] possible solutions: module(java.lang.object) 

how solve it?

remove dependencies block build file posted in question. instead, add library dependencies project structure dialog. in dialog, choose module want add dependencies for, select dependencies tab, click + button, , choose "file dependency":

project structure dialog showing option add file dependency

having said that, if you've started project in last few months on approaching recent version of android studio, should automatically picking libraries in libs directory inside module, via line:

{dir=libs, include=[*.jar]}

if line present , it's not seeing libraries, perhaps you've put them in wrong folder -- there's libs directory inside module should go. may have click "sync project gradle files" button in toolbar pick them up.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -