在Android Studio中导入Eclipse Project时出现xmlns名称空间问题

时间:2015-08-07 07:28:54

标签: android xml android-studio gradle xml-namespaces

我在Android Studio中导入了一个Eclipse项目,所有文件和依赖项似乎都已生成。每当我尝试运行该项目时,都会收到错误消息:

C:\Users\Android_Dev1\Documents\xxxx\xxxxxxxx\build\intermediates\incremental\mergeResources\debug\merger.xml:1:61: Error: The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly.
:xxxx:mergeDebugResources FAILED

values.xml 会打开错误的行:

<resources xmlns:ns1="http://www.w3.org/2000/xmlns/"> 

我尝试了Link 1Link 2,但我在 styles.xml

中既没有崩解,也没有xmlns:custom="http://schemas.android.com/apk/res-auto"

这是我的 build.gradle 文件:

apply plugin: 'android'



android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}
dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
    // compile project(':google_play_services:libproject:google-play-services_lib')
    compile project(':library-tabswipe')
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.android.support:support-v13:22.2.1'
}

我也尝试编译 appcompatv7 lib ,但问题是一样的。我哪里错了?为什么values.xml难过?

0 个答案:

没有答案