Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Android designer throwing exception when rendering

$
0
0

Recently, I believe with Visual Studio 15.5, the designer has stopped rendering altogether and throws the exception below. I reinstalled VS 2017 and the designer worked the first time I started Visual Studio but stopped afterwards. I've been searching the forums and Xamarin bug tracker for over an hour and I haven't found anything that seems to be related.

[2018-01-22 13:21:33.6] Renderer >> Info: Exception while marshalling C:\Program Files (x86)\Android\android-sdk\tools\package.xml. Probably the SDK is read-only
[2018-01-22 13:21:38.2] Renderer >> INFO: Changing layoutlib, from 0 to 25
[2018-01-22 13:21:38.2] Renderer >> 
[2018-01-22 13:21:38.2] Renderer >> INFO: Changing screen to 1
[2018-01-22 13:21:38.2] Renderer >> INFO: Indirect rendering enabled
[2018-01-22 13:21:38.8] ERROR: : Refresh failed
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.Designer.Windows.WpfSurfaceRenderer.UpdateAllDesignerItems(DesignerItem item) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 466
   at Xamarin.Designer.Windows.WpfSurfaceRenderer.QueueRenderWorld() in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 351
   at Xamarin.Designer.Windows.WpfSurfaceRenderer.OnViewportChanged() in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 85
   at Xamarin.Designer.Windows.WpfSurfaceRenderer.AdjustNativeViewport(Rectangle value, Boolean animated) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 244
   at Xamarin.Designer.Windows.WpfSurfaceRenderer.SetViewport(Rectangle newViewport, Boolean animated) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer.Windows\WpfSurfaceRenderer.cs:line 207
   at Xamarin.Designer.DesignerSurface.set_WorldRect(Rectangle value) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer\DesignerSurface.cs:line 1313
   at Xamarin.Designer.DesignerSurface.AdjustWorldRect() in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer\DesignerSurface.cs:line 1262
   at Xamarin.Designer.DesignerSurface.SetRootItem(DesignerItem item, Double originX, Double originY) in E:\A\_work\12\s\Xamarin.Designer\Xamarin.Designer\DesignerSurface.cs:line 310
   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 213
   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

Also here is the axml I'm messing with to make this as simple as I could make it. I had to remove the schema because the forums were not letting me post anything with a url.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[android schema]"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="This is only a test." />
</LinearLayout>

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>