adwiv / android-fat-aar

Gradle script that allows you to merge and embed dependencies in generted aar file
The Unlicense
1.46k stars 435 forks source link

Could not find method collectDependencies() #43

Closed emmanuele-villa closed 7 years ago

emmanuele-villa commented 7 years ago

Hi! I'm trying to use Android Studio to embed an .aar in my project. If I use java 8, everything works fine, but if I switch to java 7 I have this error:

Error: Could not find method collectDependencies() for arguments [yospace:yoAdManagement-release:unspecified;default] on project ':yospacewrapper' of type org.gradle.api.Project.

That dependency "yoAdManagement-release" is built against java 7.

This is yoAdManagement-release gradle:

configurations.maybeCreate("default")
artifacts.add("default", file('yoAdManagement-release.aar'))`

And this is the main project gradle:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

apply from: 'fat-aar.gradle'

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    embedded project(':yoAdManagement-release')
    }
}

Gradle version is 2.14.1

Thanks!

adwiv commented 7 years ago

Please update the fat-aar.gradle file.

collectDependencies method has been removed now.

emmanuele-villa commented 7 years ago

I've updated it but now I have another error, related to java7:

Error:(21, 0) Cause: com/android/manifmerger/ManifestMerger2$Invoker : Unsupported major.minor version 52.0

adwiv commented 7 years ago

Yes, you need to use Java 8 with the latest version of android tools. You can keep source compatibility at 1.7 but must use jdk8 to compile.

emmanuele-villa commented 7 years ago

i'll try it out, thanks!

adwiv commented 7 years ago

I hope it is solved. If not, kindly reopen the issue.