【问题标题】:Unknown globals when installing ZXing Scanner安装 ZXing Scanner 时的未知全局变量
【发布时间】:2015-08-06 20:58:53
【问题描述】:

我有一个需要二维码扫描仪的 Xamarin.Forms 项目。我发现 ZXing Scanner 似乎是用于此类目的的完善库。

我将它安装在相应的 android 项目中,该项目没有错误。当我想构建应用程序时,Resource.Designer.cs 使用以下几行进行了调整:

global::ZXing.Mobile.Resource.Id.contentFrame = global::my.project.Droid.Resource.Id.contentFrame;
global::ZXing.Mobile.Resource.Layout.zxingscanneractivitylayout = global::my.project.Droid.Resource.Layout.zxingscanneractivitylayout;
global::ZXing.Mobile.Resource.Layout.zxingscannerfragmentlayout = global::my.project.Droid.Resource.Layout.zxingscannerfragmentlayout;

问题是我也收到以下错误:

'my.project.Droid.Resource.Id' does not contain a definition for 'contentFrame' 
'my.project.Droid.Resource.Layout' does not contain a definition for 'zxingscanneractivitylayout'
'my.project.Droid.Resource.Layout' does not contain a definition for 'zxingscannerfragmentlayout'

我使用 NuGet 安装了 ZXing,但我也尝试手动添加 dll。我得到同样的错误。谁能帮我解决这个问题?

提前谢谢你。

【问题讨论】:

    标签: zxing xamarin.forms


    【解决方案1】:

    很有可能您的 Resource.Designer.cs 没有正确更新:

    • 清理项目构建
    • 删除 ZXing 包。
    • 清理项目构建
    • 添加ZXing包
    • 再次清理并构建项目

    如果没有帮助:

    https://kb.xamarin.com/customer/portal/articles/1638018-my-android-resource-designer-cs-file-will-not-updatehttps://forums.xamarin.com/discussion/13339/resource-designer-cs-not-regenerated/

    【讨论】:

    • 谢谢!你的提示做到了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-05
    • 2017-05-24
    • 2010-12-29
    • 1970-01-01
    • 2021-03-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多