Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manifest changes undoing after build

I made changes to my manifest (adding a new activity). I copy and pasted someone else's code (was my first time setting a parent activity). I accidentally built with the wrong code and it gave me an error about resources (which I understand). I then made the changes to the manifest, but every time I build or clean, it reverts it to the original version and spits out the errors for that. I can't find anything about building undoing code, so I appreciate any help.

       <activity
            android:name="com.willnasby.your_turn.HistoryActivity"
            android:label="History"
            android:parentActivityName="com.willnasby.your_turn.MainActivity" >

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.willnasby.your_turn.MainActivity" />
        </activity>

keeps being reverted to

        <activity
            android:name="com.example.myfirstapp.DisplayMessageActivity"
            android:label="@string/title_activity_display_message"
            android:parentActivityName="com.example.myfirstapp.MainActivity" >

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.example.myfirstapp.MainActivity" />
        </activity>

every time I try to build.

Thanks.

EDIT: I read another post about how my versions might not be synced with gradle, but I did and it's still reverting.

like image 215
Will Nasby Avatar asked Dec 22 '14 01:12

Will Nasby


Video Answer


2 Answers

I think you are modifying the Manifest in the build folder rather than the SRC folder. If you change the SRC one, that should resolve the issue.

like image 167
Shiv Avatar answered Oct 01 '22 19:10

Shiv


I had the same thing happen repeatedly just as described (in Android Studio) which brought me to this thread. Changing the manifest file to change the package path and doing a rebuild all would simply overwrite my changes.

I managed to get past it by 1) only changing one item in the manifest file (to reflect the correct package) versus trying to change several lines at once 2) rebuilding all 3) pressing run. After the attempt to run, Android Studio figured out what was going on and automatically fixed my manifest file with the proper package paths.

like image 24
ScottyD Avatar answered Oct 01 '22 18:10

ScottyD