简体   繁体   English

为什么osstudio中的osmdroid.jar文件错误引发错误?

[英]why osmdroid.jar file implentation in android studio throws error?

I am trying to use Osmdroid link for offline map in android studio and when i try to use it in the xml it throws the error, as i am using this the first time i couldn't figure out where i have done wrong please let me Error:Content is not allowed in prolog. 我正在尝试将Osmdroid 链接用于android studio中的离线地图,当我尝试在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 求助感谢莫里森·张,如果您使用的是像我这样的android studio,只需输入依赖项即可,无需导入.jar文件

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

As @MorrisonChang said, you need to add gradle dependencies as provided in How to add the osmdroid library via Gradle , which says: 正如@MorrisonChang所说的,您需要按照如何通过Gradle添加osmdroid库中的说明添加gradle依赖 ,它说:

If you use Gradle you have to add the following dependency to your build.gradle file: 如果使用Gradle,则必须将以下依赖项添加到build.gradle文件中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM