-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AAPT2] Encountering build errors due to missing Resource.* fields which aren't actually missing when aapt2 is enabled #2047
Comments
So looking at the
the old system ended up with both This is confirmed by looking at the
Our |
Fixes dotnet#2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
PR #2058 is up |
Fixes dotnet#2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
Fixes dotnet#2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
Fixes dotnet#2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
Fixes dotnet#2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
…2058) Fixes #2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
…2058) Fixes #2047 When we implemented the `ManagedResouceParser` the initial thought was that all the fields we present would be unique. So when we checked to see if the container class already had a field with the same name we uses a Case Insensitive comparision to do that. We a result this broke a number of sample applicaitons that QA have. Looking at the `ApiDemo` issue.. we have this problem Resources/layout/animation_seeking.xml` has a item with id = `android:id="@+id/seekBar" Resources/layout/content_browser.xml` has id = `android:id="@+id/seekbar" Resources/layout/content_browser_nav.xml` has id = `android:id="@+id/seekbar" Note the different casing for `seekBar`. With the old `aapt` based R.java resource parser this results in BOTH `seekbar` and `seekBar` being available in the `Resource.Desogner.cs` file. Because of the Case Insensitive check in the new parser these two fields are merged into one. It would be on a first found basis. So if `seekBar` was the first field added , then that is exposed. The other `seebar` field would be ignored. We might see this as a problem in our parser but aapt and aapt2 both produce the following in the `R.txt` file int id seekBar 0x7f08018e int id seekbar 0x7f08018f So the fix in this case is to just do a normal case check to ensure that if we have fields with different casing, they are handled correctly.
@dellis1972 sorry for the late update here but it appears that this issue is still occurring for the following two projects when using |
@pjcollins hmm. Just tested this on master and the TodoAzurePush sample works.... :/ |
@dellis1972 I just tested this locally against monodroid/master/6b8f18a24 (9.1.199.5) and am still able to reproduce the errors in the two samples mentioned above, although I am on Windows. Did you manage to try the Firebase sample as well? |
@pjcollins the problem is 960f32c We are too late for a d15-9 cp now are we not? |
So the problem is the google play stuff is causing the main |
@dellis1972 oh ok thanks, it looks like this one was CP'd to d15-9 (9102a47) so I'll have to wait for a new build. Marking as resolved for now. |
This is resolved on both windows and macos in D15-9 Preview 4 👍 |
When this fix will be released? |
I've got a handful of projects which are failing during CoreCompile due to Resource related errors when enabling aapt2. These errors appear to be falsely reported however, and don't occur when using aapt. There is also perhaps some relation with the issue described in #1983.
Steps to Reproduce
Expected Behavior
These projects should build successfully with aapt2 enabled.
Actual Behavior
http://xqa.blob.core.windows.net/gist/report-3c94cd9125164b8c89c5b1dafc5fab60.txt
http://xqa.blob.core.windows.net/gist/report-1e247c7717ac496891b088764c29eddc.txt
http://xqa.blob.core.windows.net/gist/report-85670af60ea046d48d66409f4442f0ee.txt
http://xqa.blob.core.windows.net/gist/report-827877f595704e708224b2a8802d0c53.txt
http://xqa.blob.core.windows.net/gist/report-aee90b21f9e440108a605cd8dac73567.txt
Version Information
xamarin-android/d15-9
The text was updated successfully, but these errors were encountered: