Attribute is missing namespace prefix - android

I am having the namespace prefix in my manifest file. Then also it says attribute is missing namespace prefix at the uses-permission line. Please help.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.alarm"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.alarm.MusicPlay"
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>

<uses-permission name="android.permission.READ_EXTERNAL_STORAGE"/>
Should be
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

Related

AAPT : error : unexpected element <library> found in <manifest> I tried cloning a github sample project to be run but couldnt because of this error

ERROR SHOWN:
C:\Users\User\AndroidStudioProjects\Cognitive-Emotion-Android\Sample\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:15: AAPT: error: unexpected element found in .
THIS IS MY MANIFEST CODE
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.microsoft.projectoxford.emotionsample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<library /> *this line is the problem*
<library>
</library>
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.microsoft.projectoxford.emotionsample.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>
<activity
android:name="com.microsoft.projectoxford.emotionsample.RecognizeActivity"
android:label="#string/title_activity_analyze"
android:parentActivityName="com.microsoft.projectoxford.emotionsample.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.microsoft.projectoxford.emotionsample.MainActivity" />
</activity>
<activity
android:name="com.microsoft.projectoxford.emotionsample.helper.SelectImageActivity"
android:label="#string/select_an_image"
android:screenOrientation="portrait" />
</application>
</manifest>

AndroidManifest.xml - No resource identifier found for attribute 'launchmode' in package 'android'

I am trying to use a single instance of an activity when NFC is triggered. Adding android:launchmode="singleTask" should do the trick, but I get an error when I configure the launch mode:
Attribute android:launchmode is not allowed here
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="packageName"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.NFC" />
<uses-feature
android:name="android.hardware.nfc"
android:required="false" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true" >
<activity
android:name=".NFCReader"
android:label="#string/app_name"
android:launchmode="singleTask" >
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="#xml/nfc_tech_filter" />
</activity>
</application>
</manifest>
It is android:launchMode not android:launchmode.

Adding meta tag in manifest.xml file for admob

I am trying to add meta tag to add admob to my application but it is giving me error.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.deepak.indoreinfo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name="com.deepak.indoreinfo.MainActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
</manifest>
It is giving me error No resources found that matches the given name (at 'value' with value '#integer/google_play_services_version') but this value is available in library project

Error in manifest - "Error parsing XML: unbound prefix"

My manifest.xml is,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pilot.clicker"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<!-- Required -->
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Light.NoTitleBar" >
<meta-data android:name="com.revmob.app.id" android:value="52eb635c38a33"/>
<activity android:name="com.revmob.ads.fullscreen.FullscreenActivity"
android:theme="#android:style/Theme.Translucent"
android:configChanges="keyboardHidden|orientation">
</activity>
<activity
android:name="com.pilot.clicker.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.pilot.clicker.Main"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.pilot.clicker.MAINSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.pilot.clicker.List"/>
</application>
</manifest>
The error is being displayed after the first line.
I'm attempting to integrate an ad-service 'Revmob' to my android-application. I've looked for an answer all over the internet..but just can't find a solution. Please help.
Thank you.
Put your uses-permission line after uses-sdk that is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pilot.clicker"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<!-- Required -->
<uses-permission android:name="android.permission.INTERNET"/>
Also try to clean your project go to project menu (if you are using eclipse) and clean your project and re-run it. Might be this will resolve your issue.

error <uses-sdk android:targetSdkVersion="3" android:minSdkVersion="11"></uses-sdk>

I was using Eclipse when it said that my version 10 SDK needs to be upgraded to above 17, so I upgraded to the latest vestion on SDK tools version 19.
Now when I go to AndroidManifest.xml it throws errors on these 2 lines below.
<uses-sdk android:targetSdkVersion="3" android:minSdkVersion="4"></uses-sdk>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
THE COMPLETE AndroidManifest.xml code is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.golf"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Activity1"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity2"></activity>
</application>
<uses-sdk android:targetSdkVersion="3" android:minSdkVersion="4"></uses-sdk>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
Can you help? what am I doing wrong? It was working perfectly on v10.
The issue is you have mentioned
uses-sdk android:targetSdkVersion android:minSdkVersion
two times in manifest.xml.One before application tag and one after
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.golf"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Activity1"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity2"></activity>
</application>
<uses-sdk android:targetSdkVersion="3" android:minSdkVersion="4"></uses-sdk> <-- Remove this
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>

Categories

Resources