我有一个必须使用jsoup的项目,但是我仍然坚持执行。
免责声明:我是一名新程序员,所以这可能是一个愚蠢的问题。
我尝试在jsoup网站上使用“编译”而不是“实现”
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
这是我得到的错误。我已经将jsoup.jar放到该位置。
答案 0 :(得分:0)
替换行
implementation fileTree(dir: 'libs', include: ['*.jar'])
到
api fileTree(include: ['*.jar'], dir: 'libs')
然后将罐子放入
projectfolder/app/libs/