Android:权限缺少名称和标签

Ste*_*ham 5 eclipse android-manifest android-permissions

我对Android编程很陌生,并且正在尝试创建一个应用程序,但我想确保在我做之前我确保所有内容都正确并且没有错误.我的清单文件中有以下错误:元素中缺少name属性....而tag标记权限缺少必需的属性名称.我以为我的确有一个名字("@ string/app_name"),但错误仍然存​​在!这是代码的副本:

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

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="8" />
<permission android:name="@string/app_name"></permission>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name="s.p.cunningham.checkyournumberslotteryapp.MainActivity"
        android:label="@string/app_name" >

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

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

小智 0

删除整个标签。在大多数情况下,这不是必需的,但天知道为什么当您创建新的 Android 应用程序项目时它会成为默认值。