Open muffadal53 opened 3 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
net7
to net8
build fails on Android
(#17426), similarity score: 0.75Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I can repro this issue at Android platform on the latest 17.12.0 Preview 1.0(8.0.80 & 8.0.72).
@jfversluis and @davidortinau can you please provide your inputs on this migration issue. Thanks.
@dellis1972 ?
@muffadal53 you issue is this file Platforms/Android/Resources/drawable-xxhdpi/Import.png. This happens to be a java keyword https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html. So when aapt2 (which is a newer verison that the old one) tries to generate the R.java file it is failing. The workaround is to rename this file to something that isn't a key word. I'm not entirely sure if we can do anthing this end because it would mean changing aapt2.
Description
We are migrating Resources of Android specific Resources (controls, colors) like .xml, .axml and .png files from Xamarin Forms to "MAUI->Platforms->Android->Resources" folder and getting error "APT2258 invalid symbol name 'com.companyname.mauiapp1:drawable/import'. C:\Users*User*\AppData\Local\Temp\2kevcthb.kih\com\companyname\mauiapp1\R.java"
I thought a per the thing mentioned in Blog "https://devblogs.microsoft.com/dotnet/android-resource-designer-dotnet-8/" this will automatically work but this is not the case with .Net 8.
Steps to Reproduce
Copy the Resources file from Xamarin Forms Android specific resources.
Move the resources (controls, colors) like .xml, .axml and .png etc. under "MAUI/Platforms/Android/Resources" folder structure as follows:
a. Android\Resources\color\ b. Android\Resources\drawable\ c. Android\Resources\drawable-hdpi\ d. Android\Resources\drawable-ldpi\ e. Android\Resources\drawable-mdpi\ f. Android\Resources\drawable-xhdpi\ g. Android\Resources\drawable-xxhdpi\ h. Android\Resources\drawable-xxxhdpi\ i. Android\Resources\layout\ j. Android\Resources\values\
And when we compile the solution we get following error which is as follows:
"APT2258 invalid symbol name 'com.companyname.mauiapp1:drawable/import'. C:\Users*User*\AppData\Local\Temp\2kevcthb.kih\com\companyname\mauiapp1\R.java"
Please let me know how can we solve this issue for MAUI migration.
Link to public reproduction project repository
https://github.com/muffadal53/MAUIAndroid_Resource
Version with bug
8.0.80 SR8
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android
Did you find any workaround?
N/A
Relevant log output