Android Manifest automatically creates invalid permissions

I accidentally typed an invalid permission name in the android manifest and cannot remove it. Here is my manifest code:

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission-group.SYSTEM_CLOCK" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="haveabeer.two.padc.haveabeer.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="haveabeer.two.padc.haveabeer.Records"
        android:label="@string/app_name" >
    </activity>
</application>

      

The problem is when I highlight and remove the permission and build my application for debugging, the permission reappears and prevents my application from building. I cannot edit it, I cannot delete it. If I try to do this, it recovers and says "The files in the build folder are generated and should not be edited." And yes, I tried CTRL + Z, I made a mistake too far to fix.

+3


source to share


2 answers


I am trying to do either it regenerates or it says "The files in the build folder are generated and not edited."

This is because you are not editing the correct manifest file. You are trying to edit the generated manifest file, perhaps because this is the one that Android Studio showed up on your screen. This is a bad form in the Android Studio part, and if there is no bug report on it, I get one request as I saw this behavior.

Instead, go to the real manifest file (perhaps app/src/main/AndroidManifest.xml

from your project root) and edit it.



By the way, none of your lines <uses-permission>

are correct. One leads the group and the other two refer to non-existent permissions.

UPDATE . I have filed a bug report .

+16


source


Listen to advice. You are trying to edit the generated manifest from the build folder , which is overwritten every time the project is created. Go to the source directory and change the manifest there.

The path will look something like this:



+2


source







All Articles