解析XML错误在Android Studio中发生

huangapple go评论67阅读模式
英文:

Failed to parse XML error in android studio

问题

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.tz.rebuspuzzles"
    >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <uses-feature
        android:name="android.hardware.location"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.network"
        android:required="false" />

    <application
        tools:replace="android:allowBackup"
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/app_icon"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="ExtraText"
        android:usesCleartextTraffic="true"
        tools:targetApi="m">

        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-4933880264960213~2855079080"/>

        <meta-data android:name="applovin.sdk.key"
            android:value="1p2moVFG0VBUQ_vqgpyJZ18b-8sIuVr9viNxfB8f31_VilypJa8OMgUyHaLy-f4ngCuKAZun_1Gp358RTB1B99" />

        <activity android:name=".MainActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"
            android:configChanges="orientation|keyboardHidden|screenSize"
            >

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!--
                  ATTENTION: This data URL was auto-generated. We recommend that you use the HTTP scheme.
                  TODO: Change the host or pathPrefix as necessary.
                -->
                <data
                    android:host="solveariddle.com"
                    android:scheme="http" />
            </intent-filter>
        </activity>

        <activity
            android:name=".SecondActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"
            android:configChanges="orientation|keyboardHidden|screenSize" />
        <activity       <!-- THIS IS ROW 70 FOR YOUR REFERENCE -->
            android:name=".SettingsActivity"
            android:screenOrientation="portrait" />
        <activity android:name=".SplashActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Tapjoy -->
        <activity
            android:name="com.tapjoy.TJAdUnitActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:hardwareAccelerated="true"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
        <activity
            android:name="com.tapjoy.TJContentActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:hardwareAccelerated="true"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <activity
            android:name="com.tapjoy.mraid.view.ActionHandler"
            android:configChanges="orientation|keyboardHidden|screenSize" />
        <activity
            android:name="com.tapjoy.mraid.view.Browser"
            android:configChanges="orientation|keyboardHidden|screenSize" />
        <!-- Tapjoy -->

        <!--Include the AdActivity configChanges and theme. -->
        <activity android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
        <!-- This meta-data tag is required to use Google Play Services. -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <!-- Facebook -->
        <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider1155209377959249"
            android:exported="true" />

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    </application>

</manifest>
英文:

I am finding this error in the My Manifest file in the Android studio.I am aware of the fact that this question has been asked before and the solution is to rectify the manifest file but I feel that this file doesn't have any error.(unless I have still missed something)

Failed to parse XML in C:\Users\DELL\Desktop\Android studio\AndroidStudioProjects\5.REBUS PUZZLE\RebusPuzzles\app\src\main\AndroidManifest.xml
ParseError at [row,col]:[70,9]
Message: expected start or end tag
Affected Modules: app
Note that the [row, col]:[70,9] is not the exact number as I had this error at an earlier stage and then added few tags but the row-column number remained the same even after changes which means that[70,9] might not be the exact location of the error. But still, I have marked row number 70 in my code given below

I am trying to rectify it for several days but can't find the solution.
Any help would be appreciated
Thank you

MY AndroidManifest.XML

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
xmlns:tools=&quot;http://schemas.android.com/tools&quot;
package=&quot;com.tz.rebuspuzzles&quot;
&gt;
&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
&lt;uses-feature
android:name=&quot;android.hardware.location&quot;
android:required=&quot;false&quot; /&gt;
&lt;uses-feature
android:name=&quot;android.hardware.location.gps&quot;
android:required=&quot;false&quot; /&gt;
&lt;uses-feature
android:name=&quot;android.hardware.location.network&quot;
android:required=&quot;false&quot; /&gt;
&lt;application
tools:replace=&quot;android:allowBackup&quot;
android:name=&quot;.MyApplication&quot;
android:allowBackup=&quot;true&quot;
android:icon=&quot;@mipmap/app_icon&quot;
android:label=&quot;@string/app_name&quot;
android:supportsRtl=&quot;true&quot;
android:theme=&quot;@style/AppTheme&quot;
tools:ignore=&quot;ExtraText&quot;
android:usesCleartextTraffic=&quot;true&quot;
tools:targetApi=&quot;m&quot;&gt;
&lt;meta-data
android:name=&quot;com.google.android.gms.ads.APPLICATION_ID&quot;
android:value=&quot;ca-app-pub-4933880264960213~2855079080&quot;/&gt;
&lt;meta-data android:name=&quot;applovin.sdk.key&quot;
android:value=&quot;1p2moVFG0VBUQ_vqgpyJZ18b-8sIuVr9viNxfB8f31_VilypJa8OMgUyHaLy-f4ngCuKAZun_1Gp358RTB1B99&quot; /&gt;
&lt;activity android:name=&quot;.MainActivity&quot;
android:screenOrientation=&quot;portrait&quot;
android:theme=&quot;@android:style/Theme.Light.NoTitleBar.Fullscreen&quot;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;
&gt;
&lt;intent-filter&gt;
&lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
&lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
&lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
&lt;!--
ATTENTION: This data URL was auto-generated. We recommend that you use the HTTP scheme.
TODO: Change the host or pathPrefix as necessary.
--&gt;
&lt;data
android:host=&quot;solveariddle.com&quot;
android:scheme=&quot;http&quot; /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;
&lt;activity
android:name=&quot;.SecondActivity&quot;
android:screenOrientation=&quot;portrait&quot;
android:theme=&quot;@android:style/Theme.Light.NoTitleBar.Fullscreen&quot; /&gt;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;
&lt;activity       -----------------------&gt;THIS IS ROW 70  FOR YOUR REFERENCE
android:name=&quot;.SettingsActivity&quot;
android:screenOrientation=&quot;portrait&quot; /&gt;
&lt;activity android:name=&quot;.SplashActivity&quot;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;
android:theme=&quot;@android:style/Theme.Translucent.NoTitleBar.Fullscreen&quot; &gt;
&lt;intent-filter&gt;
&lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
&lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;
&lt;!-- Tapjoy --&gt;
&lt;activity
android:name=&quot;com.tapjoy.TJAdUnitActivity&quot;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;
android:hardwareAccelerated=&quot;true&quot;
android:theme=&quot;@android:style/Theme.Translucent.NoTitleBar.Fullscreen&quot; /&gt;
&lt;activity
android:name=&quot;com.tapjoy.TJContentActivity&quot;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;
android:hardwareAccelerated=&quot;true&quot;
android:theme=&quot;@android:style/Theme.Translucent.NoTitleBar&quot; /&gt;
&lt;activity
android:name=&quot;com.tapjoy.mraid.view.ActionHandler&quot;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot; /&gt;
&lt;activity
android:name=&quot;com.tapjoy.mraid.view.Browser&quot;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot; /&gt;
&lt;!-- Tapjoy --&gt;
&lt;!--Include the AdActivity configChanges and theme. --&gt;
&lt;activity android:name=&quot;com.google.android.gms.ads.AdActivity&quot;
android:configChanges=&quot;keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize&quot;
android:theme=&quot;@android:style/Theme.Translucent&quot; /&gt;
&lt;!-- This meta-data tag is required to use Google Play Services. --&gt;
&lt;meta-data
android:name=&quot;com.google.android.gms.version&quot;
android:value=&quot;@integer/google_play_services_version&quot; /&gt;
&lt;!-- Facebook --&gt;
&lt;provider
android:name=&quot;com.facebook.FacebookContentProvider&quot;
android:authorities=&quot;com.facebook.app.FacebookContentProvider1155209377959249&quot;
android:exported=&quot;true&quot; /&gt;
&lt;meta-data
android:name=&quot;com.facebook.sdk.ApplicationId&quot;
android:value=&quot;@string/facebook_app_id&quot; /&gt;
&lt;activity
android:name=&quot;com.facebook.FacebookActivity&quot;
android:configChanges=&quot;keyboard|keyboardHidden|screenLayout|screenSize|orientation&quot;
android:label=&quot;@string/app_name&quot;
android:theme=&quot;@android:style/Theme.Translucent.NoTitleBar&quot; /&gt;
&lt;!--       &lt;activity--&gt;
&lt;!--           android:name=&quot;com.facebook.ads.InterstitialAdActivity&quot;--&gt;
&lt;!--            android:configChanges=&quot;keyboardHidden|orientation|screenSize&quot;&gt;&lt;/activity&gt;--&gt;
&lt;!-- &lt;activity android:name=&quot;com.facebook.ads.InterstitialAdActivity&quot; --&gt;
&lt;!-- android:configChanges=&quot;keyboardHidden|orientation|screenSize&quot;/&gt; --&gt;
&lt;!-- Facebook --&gt;
&lt;!-- &lt;receiver android:name=&quot;com.google.android.gms.analytics.CampaignTrackingReceiver&quot; android:enabled=&quot;true&quot; android:exported=&quot;true&quot;&gt; --&gt;
&lt;!--     &lt;intent-filter&gt;--&gt;
&lt;!--         &lt;action android:name=&quot;com.android.vending.INSTALL_REFERRER&quot; /&gt;--&gt;
&lt;!--     &lt;/intent-filter&gt;--&gt;
&lt;!-- &lt;/receiver&gt;--&gt;
&lt;!-- &lt;service android:name=&quot;com.google.android.gms.analytics.CampaignTrackingService&quot; android:enabled=&quot;true&quot; android:exported=&quot;false&quot; /&gt;--&gt;
&lt;/application&gt;
&lt;/manifest&gt;

答案1

得分: 1

我认为你上面的代码中有错误的闭合标签,尝试替换为:

<activity
android:name=".SecondActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name=".SettingsActivity"
android:screenOrientation="portrait" />
英文:

I think there are wrong closing tag from your above code,

try replace

        &lt;activity
android:name=&quot;.SecondActivity&quot;
android:screenOrientation=&quot;portrait&quot;
android:theme=&quot;@android:style/Theme.Light.NoTitleBar.Fullscreen&quot; /&gt;
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;
&lt;activity       
android:name=&quot;.SettingsActivity&quot;
android:screenOrientation=&quot;portrait&quot; /&gt;

with this

        &lt;activity
android:name=&quot;.SecondActivity&quot;
android:screenOrientation=&quot;portrait&quot;
android:theme=&quot;@android:style/Theme.Light.NoTitleBar.Fullscreen&quot; 
android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;/&gt;
&lt;activity       
android:name=&quot;.SettingsActivity&quot;
android:screenOrientation=&quot;portrait&quot; /&gt;

答案2

得分: 0

我认为错误出现在这段代码中:

android:configChanges="orientation|keyboardHidden|screenSize"

/> 移至较低位置。

英文:

I think the error is in this code:

android:configChanges=&quot;orientation|keyboardHidden|screenSize&quot;

Move /&gt; on string lower.

huangapple
  • 本文由 发表于 2020年10月12日 19:22:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/64316902.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定