Gradle dependency error

577 views Asked by At

I am using Gradle 2.4 and Android Studio 1.3. I have tried to use AppWarp's JAR file as a dependency in a libGDX project. I have got following error during Gradle sync:

Gradle DSL method not found 'compile()'

I put code below in allprojects section.

dependencies {
    compile files('libs/App42MultiPlayerGamingSDK.jar')
}
2

There are 2 answers

0
AudioBubble On BEST ANSWER

AppWarpMultiPlayerGamingSDK should be added to Android Studio as a module in the core project, by right click on project.

Select Module Setting

And SDK as a module library.

Thanks to AppWarp Support Team!

12
Tenfour04 On

You can't put "compile" in the allprojects section because that section does not have the java plugin applied, and therefore can only accept classpath dependencies. You could put apply plugin: "java" at the top of the allprojects block, but that will only lead you to the next problem...

Isn't that jar an Android-based library anyway? It will cause your other modules to fail to compile if you put it in allprojects. It needs to go in the android section's dependencies.