yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

Can't build v3.2.3 from source with android studio 3.2 #284

Open MFlisar opened 5 years ago

MFlisar commented 5 years ago

Before the update I only needed to comment out the libraryVariants.all { ... } from the squidb-android module:

//    libraryVariants.all { variant ->
//        variant.outputs.each { output ->
//            def outputFile = output.outputFile
//            if (outputFile != null && outputFile.name.endsWith('.aar')) {
//                def fileName = "${archivesBaseName}-${version}.aar"
//                output.outputFile = new File(outputFile.parent, fileName)
//            }
//        }
//    }

Afterwards I also needed to remove the java docs creation of the android module. Looks like a api vs implementation error, but this is not the case here. Compiler complains that he can't find the classes (you get a lot of can't find class errors) the java docs refer to, even functions of the class itself can't be found - no idea why though. But following solves this:

//task javadoc(type: Javadoc) {
//    source = android.sourceSets.main.java.srcDirs
//    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
//}

//task javadocJar(type: Jar, dependsOn: javadoc) {
//    classifier = 'javadoc'
//    from javadoc.destinationDir
//}

artifacts {
    //archives javadocJar
    archives sourcesJar
}

Any ideas why this happens? If not, this information may at least be useful for others... What I see as well is that suddenly compiling in debug also generates release versions... Maybe it's something with my project but it's weird, because everything was working with android studio 3.1... And other projects without squidb sources (even with squidb includes) work well...

sbosley commented 5 years ago

This could be related to doclint -- I'm not sure why Android Studio 3.2 would have changed the behavior for you though. In the squidb project, there is the following in the root build.gradle:

if (JavaVersion.current().isJava8Compatible()) {
    allprojects {
        tasks.withType(Javadoc) {
            options.addStringOption('Xdoclint:none', '-quiet')
        }
    }
}

You could try something similar. Otherwise, what you did to comment out the javadoc jar tasks is probably fine -- they're only used for building the jars that get uploaded to jcenter anyways.