recherche

Maison  >  Questions et réponses  >  le corps du texte

android-studio - AndroidManifest提示Top level element is not completed

完整的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>

PHPzPHPz2772 Il y a quelques jours1039

répondre à tous(4)je répondrai

  • PHPz

    PHPz2017-04-17 13:14:06

    你顶上的还少东西啊

        <?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">
    

    répondre
    0
  • 黄舟

    黄舟2017-04-17 13:14:06

    你的结构是这样子的吗?

    <?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

    répondre
    0
  • ringa_lee

    ringa_lee2017-04-17 13:14:06

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

    répondre
    0
  • 迷茫

    迷茫2017-04-17 13:14:06

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

    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"

    引用一个国外大神的回答

    répondre
    0
  • Annulerrépondre