Android dalvik conversion for xmlpullparser

大城市里の小女人 提交于 2019-11-30 23:34:53
J. P. Krause

I was having the same problem with a separately developed project that I was trying to integrate with an android app. The problem is that the Android API defines the class XmlPullParser (https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html) and is why this conflict arises.

I solved the problem by excluding the xmlpull dependency from the project which allowed for the Android-defined version of the classes to be used. This is how my build.gradle file looks for the app module (just the dependency section to illustrate the exclusion):

dependencies {
    compile (project(':epublib:epublib-core')) {
        exclude group: 'xmlpull'
    }
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'com.android.support:support-v4:21.0.+'
}

The syntax is important. It must be of the form

compile (project(':project-name')) {
        exclude group: 'group-name', module: 'module-name' 
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!