android-studio - AndroidManifest提示Top level element is not completed
PHPz
PHPz 2017-04-17 13:12:06
0
4
1042

完整的AndroidManifest如下
我用的是Android studio 1.1.0
错误提示是 Top level element is not completed
Google 百度 无果,表示很悲伤,我也不知道怎么就报了这个错。。。。


<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<application
    android:allowBackup="true"
    android:hardwareAccelerated="false"
    android:icon="@drawable/packagelogo"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
    <activity
        android:name=".login"
        android:label="@string/app_name"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".main"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

    </activity>
    <activity
        android:name=".newscontent"
        android:label="@string/title_activity_newscontent"
        android:parentActivityName=".main">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".main" />
    </activity>
    <activity
        android:name=".webview"
        android:label="@string/title_activity_webview"
        android:parentActivityName=".main">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".main" />
    </activity>
    <activity
        android:name=".CaptureActivity"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/title_activity_scan"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="stateAlwaysHidden">

    </activity>
</application>

PHPz
PHPz

学习是最好的投资!

répondre à tous(4)
PHPzhong

你顶上的还少东西啊

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="x.xx"
    android:versionCode="1"
    android:versionName="1.0.0">
黄舟

你的结构是这样子的吗?

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

<manifest>

    <uses-permission />
    <permission />
    <permission-tree />
    <permission-group />
    <instrumentation />
    <uses-sdk />
    <uses-configuration />  
    <uses-feature />  
    <supports-screens />  
    <compatible-screens />  
    <supports-gl-texture />  

    <application>

        <activity>
            <intent-filter>
                <action />
                <category />
                <data />
            </intent-filter>
            <meta-data />
        </activity>

        <activity-alias>
            <intent-filter> . . . </intent-filter>
            <meta-data />
        </activity-alias>

        <service>
            <intent-filter> . . . </intent-filter>
            <meta-data/>
        </service>

        <receiver>
            <intent-filter> . . . </intent-filter>
            <meta-data />
        </receiver>

        <provider>
            <grant-uri-permission />
            <meta-data />
            <path-permission />
        </provider>

        <uses-library />

    </application>

</manifest>

参考地址(需要爬墙):http://developer.android.com/guide/topics/manifest/manifest-intro.html

左手右手慢动作

我的是Application的name属性出错,和你的一样啊!

迷茫

我也遇到这个问题 不过已经解决了

1 Select element in xml that displays error.
2 Press alt + enter on the drawable item which calls error (for example: "@drawable/example").
3 And select "Uninject language/reference"

引用一个国外大神的回答

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal