gpt4 book ai didi

java - 为什么在 android studio 中执行 osmdroid.jar 文件会抛出错误?

转载 作者:行者123 更新时间:2023-11-29 20:48:13 25 4
gpt4 key购买 nike

我正在尝试使用 Osmdroid link对于 android studio 中的离线 map ,当我尝试在 xml 中使用它时,它会抛出错误,因为我是第一次使用它,我不知道我在哪里做错了请让我错误:序言中不允许包含内容。

:app:mergeDebugResources FAILED
/Users/Avi/AndroidStudioProjects/MyApplication/app/src/main/res/Library/osmdroid_android.jar
Error:Error: Content is not allowed in prolog.
Error:Execution failed for task ':app:mergeDebugResources'.> /Users/Avi/AndroidStudioProjects/MyApplication/app/src/main/res/Library/osmdroid_android.jar:0:0: Error: Content is not allowed in prolog.know how to solve this

SOLVED Thanks to Morrison Chang , if you are using android studio like me just put the dependecies no need to import the .jar file

compile 'org.osmdroid:osmdroid-android:4.2'
compile 'org.slf4j:slf4j-simple:1.6.1'

最佳答案

正如@MorrisonChang 所说,您需要添加 How to add the osmdroid library via Gradle 中提供的 gradle 依赖项,它说:

If you use Gradle you have to add the following dependency to your build.gradle file:

dependencies {
compile 'org.osmdroid:osmdroid-android:4.2'
compile 'org.slf4j:slf4j-simple:1.6.1'
}

关于java - 为什么在 android studio 中执行 osmdroid.jar 文件会抛出错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29853705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com