XML解析错误:未找到任何元素。如何解决?

时间:2017-08-01 05:58:17

标签: java html android-studio xml-parsing

我是Android Studio的初学者,我在Android应用开发过程中发现Android Studio显示错误:

  

XML解析错误:找不到元素

我该如何解决?

添加一些建议后仍然会出现错误。请检讨一下。

现在显示: 执行任务:[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,:app:prepareDebugUnitTestDependencies]

按需配置是一项孵化功能。 NDK缺少“平台”目录。 如果您使用的是NDK,请验证ndk.dir是否设置为有效的NDK目录。它目前设置为C:\ Users \ Karim Bux \ AppData \ Local \ Android \ Sdk \ ndk-bundle。 如果您不使用NDK,请取消设置ANDROID_NDK_HOME或local.properties中的NDK变量以删除此警告。

不推荐使用setTestClassesDir(File)方法,并计划在Gradle 5.0中删除它。请改用setTestClassesDirs(FileCollection)方法。 getTestClassesDir()方法已弃用,计划在Gradle 5.0中删除。请改用getTestClassesDirs()方法。 不推荐使用ConfigurableReport.setDestination(Object)方法,并计划在Gradle 5.0中将其删除。请改用ConfigurableReport.setDestination(File)方法。 :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :应用:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :应用:prepareComAndroidSupportAnimatedVectorDrawable2600Alpha1Library :应用:prepareComAndroidSupportAppcompatV72600Alpha1Library :应用:prepareComAndroidSupportConstraintConstraintLayout100Alpha7Library :应用:prepareComAndroidSupportSupportCompat2600Alpha1Library :应用:prepareComAndroidSupportSupportCoreUi2600Alpha1Library :应用:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library :应用:prepareComAndroidSupportSupportFragment2600Alpha1Library :应用:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library :应用:prepareComAndroidSupportSupportV42600Alpha1Library :应用:prepareComAndroidSupportSupportVectorDrawable2600Alpha1Library :应用:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :应用:mergeDebugResources :app:processDebugManifest UP-TO-DATE :应用:processDebugResources :应用:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :应用:prepareComAndroidSupportTestEspressoEspressoCore222Library :应用:prepareComAndroidSupportTestEspressoEspressoIdlingResource222Library :应用:prepareComAndroidSupportTestExposedInstrumentationApiPublish05Library :应用:prepareComAndroidSupportTestRules05Library :应用:prepareComAndroidSupportTestRunner05Library :应用:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl UP-TO-DATE :app:processDebugAndroidTestManifest UP-TO-DATE :app:compileDebugAndroidTestRenderscript UP-TO-DATE :app:generateDebugAndroidTestBuildConfig UP-TO-DATE :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources UP-TO-DATE :app:mergeDebugAndroidTestResources UP-TO-DATE :app:processDebugAndroidTestResources UP-TO-DATE :app:generateDebugAndroidTestSources UP-TO-DATE :app:mockableAndroidJar UP-TO-DATE :app:preDebugUnitTestBuild UP-TO-DATE :应用程序:prepareDebugUnitTestDependencies

在7s内建立成功 34个可执行的任务:21个执行,13个最新

我应该建立一个新项目吗?

My error Screenshot 1

My error screenshot 2

<?xml version="1.0" encoding="utf-8"?>
   <RelativeLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/holo_blue_light"
                tools:context="comhanumanbeniwaloffice.facebook.www.hanumanbeniwal.MainActivity" >

    <Button
        android:id="@+id/button"
        style="@android:style/Widget.Button"
        android:layout_width="350dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="13dp"
        android:background="@android:color/holo_green_light"
        android:elevation="0dp"
        android:text="परिचय"
        android:textStyle="bold"
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
        android:textSize="40dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <Button
        android:id="@+id/button2"
        style="@android:style/Widget.Button"
        android:layout_width="350dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="17dp"
        android:background="@android:color/holo_orange_dark"
        android:text="Latest News"
        android:textStyle="bold"
        android:textSize="40dp"
        android:visibility="visible"
        android:layout_below="@+id/button"
        android:layout_alignLeft="@+id/button"
        android:layout_alignStart="@+id/button" />

    <Button
        android:id="@+id/button9"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/button2"
        android:layout_marginTop="37dp"
        android:background="?android:attr/colorPressedHighlight"
        android:text="ब्लॉग"
        android:textAppearance="@style/TextAppearance.AppCompat.Menu"
        android:textSize="40dp" />

    <Button
        android:id="@+id/button10"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/button9"
        android:layout_alignBottom="@+id/button9"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:background="@android:color/holo_green_light"
        android:text="तस्वीरें"
        android:textSize="40dp" />

    <Button
        android:id="@+id/button11"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:text="विडियो"
        android:textSize="40dp"
        android:layout_below="@+id/button9"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginTop="47dp" />

    <Button
        android:id="@+id/button12"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:text="लाइव"
        android:textSize="40dp"
        android:layout_alignBaseline="@+id/button11"
        android:layout_alignBottom="@+id/button11"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <Button
        android:id="@+id/button13"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/button11"
        android:layout_marginTop="35dp"
        android:background="?android:attr/colorPressedHighlight"
        android:text="Speech"
        android:textAppearance="@android:style/TextAppearance"
        android:textSize="40dp"
        android:textStyle="bold" />

    <Button
        android:id="@+id/button14"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/holo_green_light"
        android:text="Contact"
        android:textSize="35dp"
        android:layout_alignBaseline="@+id/button13"
        android:layout_alignBottom="@+id/button13"
        android:layout_alignRight="@+id/button2"
        android:layout_alignEnd="@+id/button2"  />

0 个答案:

没有答案