ProgramingGeek ProgramingGeek - 2 months ago 8
Java Question

Tag <uses-permission> missing required attribute name

I am getting this error I change everything almost setwallpaper to set wallpapermanager and trget sdk and min is also set. Still not find the solution how to remove manifest error.
Permission added already for set_Wallpaper.


  • [2015-01-17 07:51:51 -
    com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper]
    Parser exception for
    C:\Workspaces\MakingFun\AndroidMe\AndroidManifest.xml: The element
    type "uses-permission" must be terminated by the matching end-tag
    "". [2015-01-17 07:51:51 - AndroidMe] Error in an
    XML file: aborting build.



========================================================================

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidme"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission />



<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.androidme.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.example.androidme.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.example.androidme.MainActivity" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.androidme.Menu"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.example.androidme.Menu" />

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

<activity
android:name="com.example.androidme.TextPlay"
android:label="@string/app_name" >

</activity>
<activity
android:name="com.example.androidme.Email"
android:label="@string/app_name" >

</activity>
<activity
android:name="com.example.androidme.Camera"
android:label="@string/app_name" >

</activity>
</application>

</manifest>


Code :

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.bsetwalpapr:

try {
WallpaperManager Setwalpaper = WallpaperManager.getInstance(this);
Setwalpaper.setBitmap(bmp);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

break;

case R.id.ibtakenimage:
i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, cameraData);
break;
}

}

Answer

Actually you defined <uses-permission /> but what uses permission? Sure thing you need to add name there or remove this useless tag at all.

Check the line:

<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission />
Comments