无法通过Designer,Android应用程序在visual studio中打开axml文件

时间:2018-02-11 10:17:21

标签: android xamarin

当打开布局或添加新布局时,设计师无法打开​​它, 它告诉我错误 System.ArgumentNullException:值不能为null。 参数名称:o

enter image description here

错误消息

    System.ArgumentNullException: Value cannot be null.
Parameter name: o
   at System.Runtime.InteropServices.Marshal.GetIUnknownForObjectNative(Object o, Boolean onlyInContext)
   at Xamarin.AndroidDesigner.Windows.WindowsAndroidSurfaceRenderer.UpdateD3DImageFromSharedSurface() in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner.Windows\WindowsAndroidSurfaceRenderer.cs:line 140
   at Xamarin.AndroidDesigner.Windows.WindowsAndroidSurfaceRenderer.RenderDesignerItemVisual(DesignerItem item) in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner.Windows\WindowsAndroidSurfaceRenderer.cs:line 131
   at Xamarin.Designer.Windows.WpfSurfaceRenderer.QueueRender(DesignerItem item) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 361
   at Xamarin.AndroidDesigner.AndroidDesignerSurface.HandleSessionImageChanged(Object sender, EventArgs e) in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner\AndroidDesignerSurface.cs:line 229
   at Xamarin.AndroidDesigner.AndroidDesignerSession.OnImageChanged() in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner\AndroidDesignerSession.cs:line 2321
   at Xamarin.AndroidDesigner.AndroidDesignerSession.HandleRendered(Object sender, EventArgs e) in E:\A\_work\12\s\Xamarin.Designer.Android\Xamarin.AndroidDesigner\Xamarin.AndroidDesigner\AndroidDesignerSession.cs:line 1381

Axml文件代码

  <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:minWidth="25px"
    android:minHeight="25px" />
2017年视觉工作室 sdk平台link image

sdk工具link imgage

mainfast代码

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="schemas.android.com/apk/res/android"; 
          package="App1.App1" 
          android:versionCode="1" 
          android:versionName="1.0" 
          android:installLocation="auto"> 
    <uses-sdk android:minSdkVersion="19" 
              android:targetSdkVersion="25" /> 
    <application android:allowBackup="true" 
                 android:label="@string/app_name">
    </application> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
</manifest>

0 个答案:

没有答案