Unable to acces jsoup

Leo :

I have a project where i have to use jsoup, but I'm stuck at the implementation.

Disclaimer: I am a new programmer so this might be a stupid question.

I tried, like on the website of jsoup, to with "compile" instead of "implementation"

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'

    implementation 'org.jsoup:soup:1.12.1'
    implementation 'com.google.firebase:firebase-core:16.0.1' //FB
    implementation 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.google.firebase:firebase-database:16.1.0'
}
/opt/android-studio/jre/bin/java -Dfile.encoding=US-ASCII -jar /home/leo/StudioProjects/SMV-Spohn/app/src/main/java/de/spohngymnasium/smv_spohn/jsoup-1.12.1.jar
Error: Unable to access jarfile /StudioProjects/SMV-Spohn/app/src/main/java/de/spohngymnasium/smv_spohn/jsoup-1.12.1.jar

This is the error I got. I've put jsoup.jar in the location.

Indra Kumar S :

Replace the line

implementation fileTree(dir: 'libs', include: ['*.jar'])

to

api fileTree(include: ['*.jar'], dir: 'libs')

And Place the jar inside

projectfolder/app/libs/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=166259&siteId=1