简体   繁体   English

Crashlytics:与 XML 相关的 Android Studio Gradle 错误

[英]Crashlytics : Android Studio Gradle Error related to XML

I am Getting this Error While Building App with Crashlytics使用 Crashlytics 构建应用程序时出现此错误

Error:(2) Error parsing XML: prefix must not be bound to one of the reserved >namespace names错误:(2) 解析 XML 时出错:前缀不能绑定到保留的 > 命名空间名称之一

There is a com_crashlytics_export_strings.xml added by Crashlytics Automatically. Crashlytics 自动添加了一个 com_crashlytics_export_strings.xml。 Mind you that this file is added to a module project inside my main project .请注意,此文件已添加到我的主项目中的模块项目中。 Main project doesn't have the file.主项目没有该文件。 I use its Android Studio plugin.我使用它的 Android Studio 插件。 It has the following Content.它有以下内容。

<?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">0acfc26a-32c4-4a2e-b19b-fullkey</string>
</resources>

While building the following file is Generated.在构建以下文件时会生成。 Also look at the xmlns:ns0 turn to xmlns:ns1 in the generated ones还要查看生成的 xmlns:ns0 转为 xmlns:ns1

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="http://www.w3.org/2000/xmlns/">
<declare-styleable name="CircleImageView"><attr format="dimension" name="border_width"/><attr format="color" name="border_color"/></declare-styleable>
<!-- From: file:/C:/Users/user/AndroidStudioProjects/Project%20Infinite/circleimage/src/main/res/values/strings.xml -->
<eat-comment/>
<string name="app_name">ACTIVITY_ENTRY_NAME</string>
<!-- From: file:/C:/Users/user/AndroidStudioProjects/Project%20Infinite/circleimage/src/main/res/values/com_crashlytics_export_strings.xml -->
<eat-comment/>
<string name="com.crashlytics.android.build_id" ns1:ignore="UnusedResources,TypographyDashes" translatable="false" ns1:ns0="http://schemas.android.com/tools">0acfc26a-32c4-4a2e-fullkey</string>
</resources>

If I delete the file com_crashlytics_export_strings.xml and build It runs Successfully.如果我删除文件 com_crashlytics_export_strings.xml 并构建它运行成功。 But that file will appear when I do a clean build and the problem persists.但是当我进行干净的构建并且问题仍然存在时,该文件会出现。

您的名称空间已损坏,它应该只是xml:ns但您的名称空间是xml:ns0

Mike from Fabric here.来自 Fabric 的 Mike。

We shipped out an updated version of the plugins that has a fix for this.我们发布了插件的更新版本,该版本对此进行了修复。 If you update to the latest version then this will be all set.如果您更新到最新版本,那么这将全部设置。

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

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