1

I started a new project on Android Studio with "Create Activity" checked and then selected "Balnk Activity" with navigation type "Scroolable Tabs + Swipe".

Then I tried to modify the generated "fragment_main_dummy.xml" layout to set an id to the root Relative Layout.

When I try to run the project I get the following compile error:

...\Test1\build\res\all\debug\layout\fragment_main_dummy.xml Gradle: String types not allowed (at 'id' with value 'test'). 

Even if I reset the changes the error persists. Only by manually editing the mentioned file can the problem be resolved.

So the questions are:

  • Why are all the res files copyed to the build\res\all\debug folder?
  • Why aren't these files updated when I modify the actual file in the src folder?
1
  • The problem seems to have been solved on later releases. Commented Jun 8, 2013 at 20:28

2 Answers 2

1

Simply add in the string id "@+id/" in your example "@+id/test" Regards

Sign up to request clarification or add additional context in comments.

Comments

0

This is how Intellij manages resources, it helps with id lookups etc I don't know the specifics, but it is not AndroidStudio but IntelliJ as a whole that works this way with the R file (might help you google it).

The file won't be modified as these are build files, so will be updated when you recompile the project. (i.e. when you run / deploy to a device / build an APK).

I thought IntelliJ auto built projects, so maybe you have turned this off? You can test this with File Menu: Build > Rebuild Project

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.