> Visual Studio 2015 Enterprise Update 3
> Xamarin 4.2.0.719
> Xamarin.Android 7.0.1.6
> Xamarin.iOS 10.2.0.4
问题细节
Resource.designer.cs未在Xamarin.Droid项目中更新.
>试图删除
>尝试清理内容并重建
>重启解决方案
>重启电脑
>创建新项目.
>将文件重新添加为Android资源
>试图删除Resources.Designer.cs文件
我尝试了下面的所有帖子,我可能认为这是一个重复的帖子:
> Resource.designer.cs NOT regenerating in Mono (Xamarin Studio)
> Adding new strings to resource.resx not reflecting into Designer.cs
> Xamarin Resource.Designer.cs not refreshing new id’s or events
> Xamarin Android – How to rebuild Resource.designer.cs
> Resource.designer.cs NOT regenerating in Mono (Xamarin Studio)
> Resource.Designer.cs: “Resource … does not contain a definition for …”
> Hundreds of Resource.Designer.cs build errors on latest Xamarin Forms 2.2.0.45
> Xamarin Resource.designer.cs not generating reference for newly add file
> Xamarin.Droid: Resource.Designer.cs broken after update
> Why is Resource.Designer.cs not created
还尝试了Xamarin的官方链接:
我从Codeproject尝试了这个,它说[解决]但是也没有为我自己工作:
> http://www.codeproject.com/Questions/227676/Resource-file-regenerating
解决方法
但重要的是如何发现您的特定问题,因为Android资产和打包工具中的错误未显示在Visual Studio的“错误列表”选项卡中.我必须将构建输出详细程度设置为诊断,然后搜索任务“Aapt”.找到aapt部分后,我找到了允许我在该部分底部找到并修复错误的信息.我已将它包含在日志部分中:
Executing package -f -m -M C:\Users\billm\AppData\Local\Temp\2xfnjt4r.kaj\manifest\AndroidManifest.xml -J C:\Users\billm\AppData\Local\Temp\2xfnjt4r.kaj ... res\drawable\keyboard-backspace-long.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113) res\drawable\keyboard-backspace-long.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113) res\drawable\keyboard-backspace-xlong.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113) res\drawable\keyboard-backspace-xlong.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113) res\drawable\keyboard-backspace.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113) res\drawable\keyboard-button.png: Invalid file name: must contain only [a-z0-9_.] (TaskId:113) Done executing task "Aapt". (TaskId:113)