简体   繁体   English

Android清单属性“名称”文件错误

[英]Android Manifest Attribute “name” File Error

I was following the Dev guide on Vunglee: https://github.com/Vungle/vungle-resources/blob/master/English/Android/3.2.x/android-dev-guide.md 我正在关注Vunglee上的开发人员指南: https : //github.com/Vungle/vungle-resources/blob/master/English/Android/3.2.x/android-dev-guide.md

Eclipse gives me this error in my manifest file Eclipse在清单文件中给了我这个错误

Attribute "name" bound to namespace " http://schemas.android.com/apk/res/android " was already specified for element "activity". 已经为元素“活动”指定了绑定到名称空间“ http://schemas.android.com/apk/res/android ”的属性“名称”。

My code is : 我的代码是:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kilobolt.FlyingJesus"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="5"
    android:targetSdkVersion="19" />

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity
        android:name="com.kilobolt.ZombieBird.MainActivity"
        android:name="com.vungle.publisher.FullScreenAdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

</manifest>

Please help me, what is the problem. 请帮我,有什么问题。 And i'm newbie in java. 我是Java的新手。

can't give two names to same activity. 不能在同一活动中使用两个名称。 Error is in below lines 错误在下面的行中

 android:name="com.kilobolt.ZombieBird.MainActivity"
    android:name="com.vungle.publisher.FullScreenAdActivity"

As kalyan pvs mentioned in comment, check for other duplicate attributes also. 正如kalyan pvs在评论中提到的那样,还要检查其他重复属性。

Do not use same tag to declare two Activity in AndroidManifest file, Make 2 different tag to declare it like this: 不要在AndroidManifest文件中使用相同的tag来声明两个Activity,而要使用2个不同的标签来声明它,如下所示:

 <activity  android:name="com.kilobolt.ZombieBird.MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
</activity>
<activity android:name="com.vungle.publisher.FullScreenAdActivity" 
            android:configChanges="keyboardHidden|orientation|screenSize">
</activity>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM