I am working on a project that I just started in Android SDK. In Manifest.xml, I can't find the error that it is saying that it has. The error is:
[2013-03-10 12:34:22 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Users\Zac\workspace\SlenderAR\AndroidManifest.xml: Attribute "name" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "uses- permission".
My Manifest.xml file contains the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.slenderar"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission
android:name="android.permission.CAMERA"
android:name="android.permission.FINE_LOCATION" />
<uses-feature
android:name="android.hardware.camera" android:required="true"
android:name="android.hardware.camera.autofocus" android:required="false"
android:name="android.hardware.location.gps" android:required="true"
android:name="android.hardware.sensor.compass" android:required="true"
android:name="android.hardware.sensor.gyroscope" android:required="true"
android:name="android.hardware.sensor.accelerometer" android:required="true" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" android:debuggable="true">
<activity
android:name="com.example.slenderar.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>
</manifest>
Your block
<uses-permission
android:name="android.permission.CAMERA"
android:name="android.permission.FINE_LOCATION" />
Should be
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FINE_LOCATION" />
Only one name is allowed in each permission block. Similar things can be said about the uses-feature blocks.
Do not combine two permissions with each other:
Try this code:
<uses-permission android:name="android.permission.FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.CAMERA"></uses-permission>
remove also
<?xml version="1.0" encoding="utf-8"?>
and replace your old permissions with the right code syntax
<uses-permission android:name="android.permission.FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.CAMERA"></uses-permission>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.sqlitenew.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>
<uses-permission android:name="android.permission.FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.CAMERA"></uses-permission>
</manifest>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.