0
내 Android 앱은 XML을 사용하여 SPring Boot REST 서비스와 통신합니다.Android : XML (un) 마샬링에 "jackson-dataformat-xml"을 사용할 수 있습니까?
JAXB는 Android에서 사용하기가 쉽지 않습니다. 그래서, 나는 jackson-dataformat-xml을 사용하는 것에 대해 읽었다. List of (nested) objects로 작업합니다.
내 질문 : 이것은 XML 메시지를 마샬링하는 데 선호되는 방법입니까? 안드로이드에 대한 좋은 옵션은 무엇입니까? 그렇다면 아래 문제를 해결하는 데 도움을 줄 수 있습니까?
JUnit 테스트가 쉽게 통과합니다.
packagingOptions {
pickFirst 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
}
dependencies {
....
compile 'com.fasterxml.jackson.core:jackson-core:2.1.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.1.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.1.2'
compile('com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.3.0')
}
응용 프로그램을 실행할 수 없습니다. 나는이 사람처럼, 모든 종류의 오류를 얻을 :
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.codehaus.stax2.XMLStreamLocation2$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
편집 : 단순 XML 좋은 크레딧을 가지고 있음을 볼 수있는 평균 시간에서 .