AppCenter Build:错误 CS0103:名称 'Android' 在当前上下文中不存在
AppCenter Build: error CS0103: The name 'Android' does not exist in the current context
我的 AppCenter Build 服务有问题。
我正在构建 Xamarin.Forms
项目,它在我使用 Android 命名空间的所有行上显示错误。
error CS0103: The name 'Android' does not exist in the current context
我使用 类 的完整路径,而不是 "using"
我使用这样的命令 Android.OS.Enveironment . . . .
,这会导致错误。
有什么解决办法吗?
在我的例子中,这是因为我在一个 .Net Standard
项目中引用了 Mono.Android
,该项目运行良好,但 AppCenter 未将其识别为 Android 项目(错误? ) 因此 AppCenter 不知道它必须使用自己的 Mono.Android
库来构建项目。
我通过选择 Android 库 作为我需要 Mono.Android
.
的项目的模板来解决这个问题
我通过以下步骤解决了这个问题:
- 删除projectname.dependencies.assemblies.Mono.Android
- Re-add projectname.dependencies.assemblies.Mono.Android
我re-addedMono.androidv10.0
不再这样:名称 'Android' 在当前上下文中不存在
我的 AppCenter Build 服务有问题。
我正在构建 Xamarin.Forms
项目,它在我使用 Android 命名空间的所有行上显示错误。
error CS0103: The name 'Android' does not exist in the current context
我使用 类 的完整路径,而不是 "using"
我使用这样的命令 Android.OS.Enveironment . . . .
,这会导致错误。
有什么解决办法吗?
在我的例子中,这是因为我在一个 .Net Standard
项目中引用了 Mono.Android
,该项目运行良好,但 AppCenter 未将其识别为 Android 项目(错误? ) 因此 AppCenter 不知道它必须使用自己的 Mono.Android
库来构建项目。
我通过选择 Android 库 作为我需要 Mono.Android
.
我通过以下步骤解决了这个问题:
- 删除projectname.dependencies.assemblies.Mono.Android
- Re-add projectname.dependencies.assemblies.Mono.Android 我re-addedMono.androidv10.0 不再这样:名称 'Android' 在当前上下文中不存在