Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin C#Android<;获取异常详细信息时超时>;_C#_Android_Xamarin.android - Fatal编程技术网

Xamarin C#Android<;获取异常详细信息时超时>;

Xamarin C#Android<;获取异常详细信息时超时>;,c#,android,xamarin.android,C#,Android,Xamarin.android,我正在开发一个android应用程序,我偶然发现了一个无法通过的错误。我所有的研究都让我相信我遗漏了一些xml元素,但我不知道是什么,所以我希望有更专业的人能指出这一点 visual studio中的错误是 Unhandled Exception: Android.Views.InflateException: <Timeout exceeded getting exception details> 未处理的异常: Android.Views.InflateException:

我正在开发一个android应用程序,我偶然发现了一个无法通过的错误。我所有的研究都让我相信我遗漏了一些xml元素,但我不知道是什么,所以我希望有更专业的人能指出这一点

visual studio中的错误是

Unhandled Exception:

Android.Views.InflateException: <Timeout exceeded getting exception details>
未处理的异常:
Android.Views.InflateException:
错误来自我的roundbutton.xml文件

    <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
  <solid android:color="#536878" />
  <corners android:bottomRightRadius="25dp"
      android:bottomLeftRadius="25dp"
      android:topRightRadius="25dp"
      android:topLeftRadius="25dp"/>
</shape>

我从我的主要活动xml中调用代码,上面的调用是:

<ImageButton
    android:src="@mipmap/baseline_settings_white_36"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:id="@+id/settingsButton_zone2"
    android:layout_marginBottom="0.0dp"
    android:background = "@mipmap/roundbutton"/>

那么,有人看到我在圆形按钮xml中遗漏了什么吗?如果我删除了
android:background=“@mipmap/roundbutton”
,那么我就不会再收到错误,我的应用程序也会运行


提前谢谢。

所以我最终发现了问题所在

我最终只是做了一个变通方法,而不是使用xml文件来让按钮循环,而是用C#编程使它们循环。这是可行的,但后来我终于弄明白了xml文件不起作用的原因

事实证明,我已经将该文件放在mipmap/anydpi-v26文件夹中。我的模拟器试图从它的mipmap/xhdpi文件夹中读取数据,因为它不存在于其中,所以我得到了超时。解决方案是将文件从mipmap文件夹中移出,放入一个不会因设备屏幕大小而改变的文件夹结构中


希望这能帮助其他人走出困境

您是在没有调试程序的情况下运行时看到超时,还是仅在调试时看到超时?如果只有在调试时才会发生这种情况,那么当您不调试时会发生什么情况?日志中有任何内容吗?我没有尝试过不调试,我可以尝试,但我需要调试我的应用程序,因此我希望它能够正常工作。是的,您肯定需要调试-但是如果调试仅在一种特定情况下失败,那就没什么大问题了。