XML解析错误(Android Studio)

沙朗·巴拉德瓦伊

我已经制作了一个xml文件(使用android studio),这使我可以在整个android应用程序中使用工具栏。但是,我只是继续遇到以下错误:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar     
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:background="@color/ColorPrimary"
 android:elevation="4dp" >

</android.support.v7.widget.Toolbar> 

错误:

Error parsing XML: XML or text declaration not at start of >entity

Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: 
org.gradle.process.internal.ExecException: Process 'command 
>'/root/Android/Sdk/build-tools/23.0.0_rc2/aapt'' finished with non->zero 
exit value 1
安德里亚·辛西斯(Andrea Cinesi)

用这个

<?xml version="1.0" encoding="utf-8"?>

<android.support.v7.widget.Toolbar

    xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    android:id="@+id/toolbar"

    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    android:minHeight="?attr/actionBarSize"

    app:navigationContentDescription="@string/abc_action_bar_up_description"

    android:background="?attr/colorPrimary"

    app:navigationIcon="?attr/homeAsUpIndicator"

    app:title="@string/action_settings"

    />

这是另一个例子

<RelativeLayout

    xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    android:orientation="vertical"

    android:layout_width="match_parent"

    android:layout_height="match_parent">

 

    <android.support.v7.widget.Toolbar

        android:id="@+id/toolbar"

        android:layout_width="match_parent"

        android:layout_height="8dp"

        android:minHeight="?attr/actionBarSize"

        android:background="?attr/colorPrimary"

        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

 

    <FrameLayout

        android:id="@+id/putPrefsContentHere"

        android:layout_width="match_parent"

        android:layout_height="wrap_content" />

 

</RelativeLayout>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

XML解析错误在哪里(Android Studio)?

来自分类Dev

Android Studio错误:无法解析Xml中的符号

来自分类Dev

错误:(2)解析XML时出错:XML或文本声明不在实体android studio的开头

来自分类Dev

Android Studio错误:无法解析符号“视图”

来自分类Dev

Android Studio错误:无法解析。.<库名称>

来自分类Dev

Android Studio,获取错误“无法解析方法”

来自分类Dev

错误:“无法解析符号'@ string / edit_message'“ Android Studio

来自分类Dev

将解析库导入Android Studio,是否发生gradle错误?

来自分类Dev

将解析库导入Android Studio,是否发生gradle错误?

来自分类Dev

无法解析 Android Studio 中的符号“来自”错误

来自分类Dev

Android Studio:错误:无效的恶魔和“R”符号无法解析

来自分类Dev

错误无法解析 Android Studio 中的符号 activity_main

来自分类Dev

解析Android Studio ListView

来自分类Dev

Android Studio 解析 RRS

来自分类Dev

Android XML 解析错误

来自分类Dev

在Android Studio中的AndroidManifest.xml上编辑错误

来自分类Dev

XML错误“网格布局无用”(Android Studio)

来自分类Dev

XML错误“网格布局无用”(Android Studio)

来自分类Dev

Android Studio自动生成的xml文件有错误

来自分类Dev

Android studio - 在类和 xml 中停止立即错误检查

来自分类Dev

Android Studio 替换我的 xml 布局(错误)

来自分类Dev

buildTypes Android Studio错误

来自分类Dev

HAMX的Android Studio错误

来自分类Dev

Android Studio渲染错误

来自分类Dev

Android Studio FloatingActionButton错误

来自分类Dev

Android Studio中的错误

来自分类Dev

Android Studio依赖错误

来自分类Dev

Android Studio Gradle错误

来自分类Dev

Android Studio构建错误

Related 相关文章

热门标签

归档