![](/img/trans.png)
[英]Xamarin Traditional Android Project Build On Visual Studio 2017 But Have Error
[英]Project build error in xamarin studio
在构建项目时会显示错误,并且构建失败。
错误重定向到下面的axml
文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/webView" />
</LinearLayout>
错误:
C:\Users\Documents\Projects\\\Resources\layout\Main.axml(1,1): Error CS0116:
A namespace cannot directly contain members such as fields or methods (CS0116)
(ABC)
检查Main.axml文件的“生成操作”。 应该将其设置为Android Resource,但听起来像是将其设置为Compile 。
右键单击Main.axml文件,然后使用“构建操作”菜单进行更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.