linkedin / URL-Detector

A Java library to detect and normalize URLs in text
783 stars 186 forks source link

On Android I cant build my project. #5

Closed XinyueZ closed 8 years ago

XinyueZ commented 8 years ago

Error:PARSE ERROR: Error:unsupported class file version 52.0 Error:...while parsing com/linkedin/urls/HostNormalizer.class Error:1 error; aborting Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

XinyueZ commented 8 years ago

I have solved: Add followings to build.gradle

dependencies {
    sourceCompatibility = 1.7
    targetCompatibility = 1.7

    compile 'org.apache.commons:commons-lang3:3.4'
}
tzuhanjan commented 8 years ago

It should be pulled in through the defaultEnvironment.gradle. What command are you using to build?

tjan-mn3:URL-Detector tjan$ gradle build Parallel execution with configuration on demand is an incubating feature. Configuring using default environment (defaultEnvironment.gradle)... :url-detector:compileJava Download https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar :url-detector:compileJava UP-TO-DATE :url-detector:processResources UP-TO-DATE :url-detector:classes UP-TO-DATE :url-detector:jar UP-TO-DATE :url-detector:assemble UP-TO-DATE :url-detector:compileTestJava Download https://repo1.maven.org/maven2/org/testng/testng/6.1.1/testng-6.1.1.jar Download https://repo1.maven.org/maven2/junit/junit/3.8.1/junit-3.8.1.jar Download https://repo1.maven.org/maven2/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar Download https://repo1.maven.org/maven2/com/beust/jcommander/1.12/jcommander-1.12.jar Download https://repo1.maven.org/maven2/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar :url-detector:compileTestJava UP-TO-DATE :url-detector:processTestResources UP-TO-DATE :url-detector:testClasses UP-TO-DATE :url-detector:test UP-TO-DATE :url-detector:check UP-TO-DATE :url-detector:build UP-TO-DATE

BUILD SUCCESSFUL

XinyueZ commented 8 years ago

@tzuhanjan I pull your project as submodule and build my sample with build.gradle. As you mention here I switch to defaultEnvironment.gradle and it works.

Thanks for your info