-
Notifications
You must be signed in to change notification settings - Fork 525
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
Csc errors in Resource.designer.cs during a regular build #3237
Comments
I found out how to reproduce this command-line:
You can solve the issue by either removing Here is a log: error.zip |
Fixes: dotnet#3237 We have been made aware of a random error when building Xamarin.Forms from source: Errors AppCompat\NavigationPageRenderer.cs(461,34): error CS0117: 'Resource.Attribute' does not contain a definition for 'actionBarSize' Renderers\ShellItemRenderer.cs(60,45): error CS0117: 'Resource' does not contain a definition for 'Layout' ... plus more I was able to reproduce this in the IDE, but also with: > git clean -dxf > msbuild Xamarin.Forms.sln /restore /m I could resolve the issue by either: * Change the setting in the IDE to use 1 MSBuild node * Remove `/m`, which builds in parallel * Add `/p:AndroidUseAapt2=False` After debugging, the problem appeared to be this file was completely blank: Xamarin.Forms.Platform.Android\obj\Debug\90\R.txt Then when I reviewed the `aapt2 link` call: Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw --custom-package xamarin.forms.platform.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\resources.apk There were no `-R` arguments? This meant that the `.flata` files did not exist at all??? Yet they *did* exist, and I could see them generated in the log prior to this call... I added logging and tried it again: Aapt2Link ... Archive does not exist: obj\Debug\90\flata\43df68e0d20944e28151b722a21d9b9ef640254e.flata Archive does not exist: obj\Debug\90\flata\74a3f1c210308ec085909c723a8990aa914c1a71.flata Archive does not exist: obj\Debug\90\flata\4db0a001e031ddf3be314c5355f4fbbc0ce43f64.flata Archive does not exist: obj\Debug\90\flata\b12a43cde6840d15dadec10f8fb3ca5c547acc69.flata Archive does not exist: obj\Debug\90\flata\3b2cd76e696829add57b46e563c7a78bb42b7b11.flata Archive does not exist: obj\Debug\90\flata\ba386569fd62aa4d06aae04e8fc5ea2f4c505ecb.flata Archive does not exist: obj\Debug\90\flata\5ad21817f3b88df6b142d14cfcd0aa60312a41f2.flata Archive does not exist: obj\Debug\90\flata\86863b3e6cc326508270b8c30f738959fb241678.flata Archive does not exist: obj\Debug\90\flata\6a09985ebabd8c9070c92b8338f9c6f6198d0f0a.flata Archive does not exist: obj\Debug\90\flata\02d2c22bddc9d6810e8dc8cbdbe03619212dddc0.flata Archive does not exist: obj\Debug\90\flata\081a2e056100d972d2fc4067acb8a5034ac9ac9c.flata Archive does not exist: obj\Debug\90\flata\bd1122dc1010f54688ad4b996adc4af4b964358a.flata Archive does not exist: obj\Debug\90\flata\\compiled.flata Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2 --custom-package xamarin.forms.maps.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\resources.apk That is when I realized all these were relative paths. We need to be using `AsyncTask.WorkingDirectory` here. After fixing that the problem went away. I kept the logging as well, since it should be helpful in the future. Unfortunately, I don't see how to add a test for this issue, since the `/m` switch does not work with `xabuild.exe` on Windows. MSBuild's out-of-process node logic gets a bit confused. We should revisit later, and add new MSBuild tests using `/m` after we get the tests running against the system install on Azure DevOps.
Fixes: #3237 We have been made aware of a random error when building Xamarin.Forms from source: Errors AppCompat\NavigationPageRenderer.cs(461,34): error CS0117: 'Resource.Attribute' does not contain a definition for 'actionBarSize' Renderers\ShellItemRenderer.cs(60,45): error CS0117: 'Resource' does not contain a definition for 'Layout' ... plus more I was able to reproduce this in the IDE, but also with: > git clean -dxf > msbuild Xamarin.Forms.sln /restore /m I could resolve the issue by either: * Change the setting in the IDE to use 1 MSBuild node * Remove `/m`, which builds in parallel * Add `/p:AndroidUseAapt2=False` After debugging, the problem appeared to be this file was completely blank: Xamarin.Forms.Platform.Android\obj\Debug\90\R.txt Then when I reviewed the `aapt2 link` call: Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw --custom-package xamarin.forms.platform.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\resources.apk There were no `-R` arguments? This meant that the `.flata` files did not exist at all??? Yet they *did* exist, and I could see them generated in the log prior to this call... I added logging and tried it again: Aapt2Link ... Archive does not exist: obj\Debug\90\flata\43df68e0d20944e28151b722a21d9b9ef640254e.flata Archive does not exist: obj\Debug\90\flata\74a3f1c210308ec085909c723a8990aa914c1a71.flata Archive does not exist: obj\Debug\90\flata\4db0a001e031ddf3be314c5355f4fbbc0ce43f64.flata Archive does not exist: obj\Debug\90\flata\b12a43cde6840d15dadec10f8fb3ca5c547acc69.flata Archive does not exist: obj\Debug\90\flata\3b2cd76e696829add57b46e563c7a78bb42b7b11.flata Archive does not exist: obj\Debug\90\flata\ba386569fd62aa4d06aae04e8fc5ea2f4c505ecb.flata Archive does not exist: obj\Debug\90\flata\5ad21817f3b88df6b142d14cfcd0aa60312a41f2.flata Archive does not exist: obj\Debug\90\flata\86863b3e6cc326508270b8c30f738959fb241678.flata Archive does not exist: obj\Debug\90\flata\6a09985ebabd8c9070c92b8338f9c6f6198d0f0a.flata Archive does not exist: obj\Debug\90\flata\02d2c22bddc9d6810e8dc8cbdbe03619212dddc0.flata Archive does not exist: obj\Debug\90\flata\081a2e056100d972d2fc4067acb8a5034ac9ac9c.flata Archive does not exist: obj\Debug\90\flata\bd1122dc1010f54688ad4b996adc4af4b964358a.flata Archive does not exist: obj\Debug\90\flata\\compiled.flata Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2 --custom-package xamarin.forms.maps.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\resources.apk That is when I realized all these were relative paths. We need to be using `AsyncTask.WorkingDirectory` here. After fixing that the problem went away. I kept the logging as well, since it should be helpful in the future. Unfortunately, I don't see how to add a test for this issue, since the `/m` switch does not work with `xabuild.exe` on Windows. MSBuild's out-of-process node logic gets a bit confused. We should revisit later, and add new MSBuild tests using `/m` after we get the tests running against the system install on Azure DevOps.
Fixes: #3237 We have been made aware of a random error when building Xamarin.Forms from source: Errors AppCompat\NavigationPageRenderer.cs(461,34): error CS0117: 'Resource.Attribute' does not contain a definition for 'actionBarSize' Renderers\ShellItemRenderer.cs(60,45): error CS0117: 'Resource' does not contain a definition for 'Layout' ... plus more I was able to reproduce this in the IDE, but also with: > git clean -dxf > msbuild Xamarin.Forms.sln /restore /m I could resolve the issue by either: * Change the setting in the IDE to use 1 MSBuild node * Remove `/m`, which builds in parallel * Add `/p:AndroidUseAapt2=False` After debugging, the problem appeared to be this file was completely blank: Xamarin.Forms.Platform.Android\obj\Debug\90\R.txt Then when I reviewed the `aapt2 link` call: Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw --custom-package xamarin.forms.platform.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\resources.apk There were no `-R` arguments? This meant that the `.flata` files did not exist at all??? Yet they *did* exist, and I could see them generated in the log prior to this call... I added logging and tried it again: Aapt2Link ... Archive does not exist: obj\Debug\90\flata\43df68e0d20944e28151b722a21d9b9ef640254e.flata Archive does not exist: obj\Debug\90\flata\74a3f1c210308ec085909c723a8990aa914c1a71.flata Archive does not exist: obj\Debug\90\flata\4db0a001e031ddf3be314c5355f4fbbc0ce43f64.flata Archive does not exist: obj\Debug\90\flata\b12a43cde6840d15dadec10f8fb3ca5c547acc69.flata Archive does not exist: obj\Debug\90\flata\3b2cd76e696829add57b46e563c7a78bb42b7b11.flata Archive does not exist: obj\Debug\90\flata\ba386569fd62aa4d06aae04e8fc5ea2f4c505ecb.flata Archive does not exist: obj\Debug\90\flata\5ad21817f3b88df6b142d14cfcd0aa60312a41f2.flata Archive does not exist: obj\Debug\90\flata\86863b3e6cc326508270b8c30f738959fb241678.flata Archive does not exist: obj\Debug\90\flata\6a09985ebabd8c9070c92b8338f9c6f6198d0f0a.flata Archive does not exist: obj\Debug\90\flata\02d2c22bddc9d6810e8dc8cbdbe03619212dddc0.flata Archive does not exist: obj\Debug\90\flata\081a2e056100d972d2fc4067acb8a5034ac9ac9c.flata Archive does not exist: obj\Debug\90\flata\bd1122dc1010f54688ad4b996adc4af4b964358a.flata Archive does not exist: obj\Debug\90\flata\\compiled.flata Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2 --custom-package xamarin.forms.maps.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\resources.apk That is when I realized all these were relative paths. We need to be using `AsyncTask.WorkingDirectory` here. After fixing that the problem went away. I kept the logging as well, since it should be helpful in the future. Unfortunately, I don't see how to add a test for this issue, since the `/m` switch does not work with `xabuild.exe` on Windows. MSBuild's out-of-process node logic gets a bit confused. We should revisit later, and add new MSBuild tests using `/m` after we get the tests running against the system install on Azure DevOps.
Fixes: #3237 We have been made aware of a random error when building Xamarin.Forms from source: Errors AppCompat\NavigationPageRenderer.cs(461,34): error CS0117: 'Resource.Attribute' does not contain a definition for 'actionBarSize' Renderers\ShellItemRenderer.cs(60,45): error CS0117: 'Resource' does not contain a definition for 'Layout' ... plus more I was able to reproduce this in the IDE, but also with: > git clean -dxf > msbuild Xamarin.Forms.sln /restore /m I could resolve the issue by either: * Change the setting in the IDE to use 1 MSBuild node * Remove `/m`, which builds in parallel * Add `/p:AndroidUseAapt2=False` After debugging, the problem appeared to be this file was completely blank: Xamarin.Forms.Platform.Android\obj\Debug\90\R.txt Then when I reviewed the `aapt2 link` call: Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw --custom-package xamarin.forms.platform.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\dief34vx.ctw\resources.apk There were no `-R` arguments? This meant that the `.flata` files did not exist at all??? Yet they *did* exist, and I could see them generated in the log prior to this call... I added logging and tried it again: Aapt2Link ... Archive does not exist: obj\Debug\90\flata\43df68e0d20944e28151b722a21d9b9ef640254e.flata Archive does not exist: obj\Debug\90\flata\74a3f1c210308ec085909c723a8990aa914c1a71.flata Archive does not exist: obj\Debug\90\flata\4db0a001e031ddf3be314c5355f4fbbc0ce43f64.flata Archive does not exist: obj\Debug\90\flata\b12a43cde6840d15dadec10f8fb3ca5c547acc69.flata Archive does not exist: obj\Debug\90\flata\3b2cd76e696829add57b46e563c7a78bb42b7b11.flata Archive does not exist: obj\Debug\90\flata\ba386569fd62aa4d06aae04e8fc5ea2f4c505ecb.flata Archive does not exist: obj\Debug\90\flata\5ad21817f3b88df6b142d14cfcd0aa60312a41f2.flata Archive does not exist: obj\Debug\90\flata\86863b3e6cc326508270b8c30f738959fb241678.flata Archive does not exist: obj\Debug\90\flata\6a09985ebabd8c9070c92b8338f9c6f6198d0f0a.flata Archive does not exist: obj\Debug\90\flata\02d2c22bddc9d6810e8dc8cbdbe03619212dddc0.flata Archive does not exist: obj\Debug\90\flata\081a2e056100d972d2fc4067acb8a5034ac9ac9c.flata Archive does not exist: obj\Debug\90\flata\bd1122dc1010f54688ad4b996adc4af4b964358a.flata Archive does not exist: obj\Debug\90\flata\\compiled.flata Executing link --manifest C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\manifest\AndroidManifest.xml --java C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2 --custom-package xamarin.forms.maps.android --auto-add-overlay -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar" --output-text-symbols obj\Debug\90\R.txt -o C:\Users\jopepper\AppData\Local\Temp\cxwzxiiv.he2\resources.apk That is when I realized all these were relative paths. We need to be using `AsyncTask.WorkingDirectory` here. After fixing that the problem went away. I kept the logging as well, since it should be helpful in the future. Unfortunately, I don't see how to add a test for this issue, since the `/m` switch does not work with `xabuild.exe` on Windows. MSBuild's out-of-process node logic gets a bit confused. We should revisit later, and add new MSBuild tests using `/m` after we get the tests running against the system install on Azure DevOps.
Release status update A new Release version has now been published that includes the fix for this item. Fix included in Xamarin.Android 10.0.0.43 Fix included on Windows in Visual Studio 2019 version 16.3. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/. Fix included on macOS in Visual Studio 2019 for Mac version 8.3. To get the new version that includes the fix, check for the latest updates on the Stable updater channel. |
Steps to Reproduce
Filing this, as I have not figured out what is wrong yet...
git clean -dxf
Xamarin.Forms.ControlGallery.Android
-- a Xamarin.Android app projectResource.designer.cs
Rebuilding
Xamarin.Forms.ControlGallery.Android
fixes the issue.The actual file looked like this:
In a working example, I see a lot of logs like this:
Those are absent in the failing build log.
Expected Behavior
A regular build should not encounter build errors.
Actual Behavior
You get build errors in code using
Resource.designer.cs
.Version Information
@PureWeen was hitting this in VS Windows, using Xamarin.Android 9.4.0.34.
I wasn't able to reproduce myself, but logs are attached.
Log File
An example of a working/non-working build in here: aapt2.zip
The text was updated successfully, but these errors were encountered: