Android - 前缀 "xmlns"不能显式绑定(bind)到任何命名空间; "xmlns"的命名空间也不能显式绑定(bind)到任何前缀

标签 android git android-studio gradle xml-namespaces

有没有人遇到这个“xmlns”命名空间问题(见下文)?我无法再构建我的工作项目。

  • 起初我以为这是我的 git 分支,所以我切换到 origin develop 和 master 分支 - 问题仍然存在。
  • 我清理并重建了我的项目 - 问题仍然存在。
  • 我清理并同步了我的成绩文件 - 问题仍然存在。
  • 最后我尝试重新安装 Android Studio 并重新创建我的 git 存储库 - 问题仍然存在。

    The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly.
    Error: The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly.
    :{project}:mergeReleaseResources FAILED
    Execution failed for task ':{project}:mergeReleaseResources'.
    > {project}/build/intermediates/incremental/mergeResources/release/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.
    

注意:问题似乎类似于 Android Gradle merged Values.xml uses wrong namespace ,但我找不到未使用的命名空间。我进行了检查,但没有发现未使用的命名空间。

最佳答案

在我的例子中,删除 com crashlytics export strings.xml 文件修复了这个错误。

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<!--
  This file is automatically generated by Crashlytics to uniquely 
  identify individual builds of your Android application.

  Do NOT modify, delete, or commit to source control!
-->
<string xmlns:ns0="http://schemas.android.com/tools" name="com.crashlytics.android.build_id" ns0:ignore="UnusedResources,TypographyDashes" translatable="false">xxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</string>
</resources>

关于Android - 前缀 "xmlns"不能显式绑定(bind)到任何命名空间; "xmlns"的命名空间也不能显式绑定(bind)到任何前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29221236/

相关文章:

Android maven 插件 : renameManifestPackage results in Resources$NotFoundException

android - 当我锁定屏幕时,Android 上的 OpenSL 音频停止 5.0.1 OK 6.0.1 Not OK

android - 在android中连续播放mp3文件

Android 穿戴设置 Activity

git - 在 Git 中切换远程分支

java - Android Studio ThermoCalc 华氏度到摄氏度 反之亦然

java - 无法打开某些 Activity java 文件

git - 跨 Windows 和 Linux 的 P4 Root 和 Altroot

git - 使用 Git 维护项目

android - 使用Gradle从APK中删除库项目