簡體   English   中英

Xamarin,Visual Studio 2015組件元素未聲明

[英]xamarin, visual studio 2015 component element is not declared

我是移動編程和c#的新手,我開始在一家公司實習,公司希望我學習xamarin並為其ERP項目執行一個小型應用程序。 無論如何,我進行得很好,但是我必須做一個導航抽屜菜單,我在網上檢查了示例並下載了源代碼,以查看項目是如何構建的,但是當我嘗試運行自己的應用程序並下載項目時,出現以下項目的錯誤axml文件:我已經下載了

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/myDrawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<!-- The main content view -->
    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <TextView
            android:id="@+id/tvText"
            android:text="Hey slide from left or right"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center" />
    </FrameLayout>
<!-- The left navigation drawer -->
    <ListView
        android:id="@+id/leftListView"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="left"
        android:choiceMode="singleChoice"
        android:divider="#D2D2D2"
        android:dividerHeight="2dp"
        android:background="#F2F2F2" />
<!-- The right navigation drawer -->
    <ListView
        android:id="@+id/rightListView"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="right"
        android:choiceMode="singleChoice"
        android:divider="#D2D2D2"
        android:dividerHeight="2dp"
        android:background="#F2F2F2" />
</android.support.v4.widget.DrawerLayout>

越來越

未聲明“ android.support.v4.widget.DrawerLayout”元素。 DrawerLayoutTutorial C:\\ Users \\ cankut \\ Desktop \\ Xamarin27Done \\ DrawerLayoutTutorial \\ DrawerLayoutTutorial \\ Resources \\ layout \\ Main.axml 2

另外,當我嘗試調試/運行程序時,出現以下錯誤

解壓縮失敗。 請下載https://dl-ssl.google.com/android/repository/android_m2repository_r28.zip並將其解壓縮到C:\\ Users \\ cankut \\ AppData \\ Local \\ Xamarin \\ Xamarin.Android.Support.v4 \\ 23.2.1.0 \\ content目錄。 DrawerLayoutTutorial C:\\ Program Files(x86)\\ MSBuild \\ Xamarin \\ Android \\ Xamarin.Android.Common.target

但是我有組件android.support.v4,android支持設計器。 我也曾嘗試在nuget軟件包中安裝組件,但仍然沒有運氣,我也檢查了我的問題,但沒有運氣,看來我的問題相差甚遠,而且我的android支持存儲庫也是最新的,感謝您的回答。

嗨,這是因為Xamarin無法完全下載zip文件

請參閱http://duanenewman.net/blog/post/2016/03/16/Xamarin-Build-Errors-Please-Install-Package-XamarinAndroidSupportv4.aspx

als嘗試刪除該位置的文件並重建它會為您下載或手動從指定的url下載並添加到zip文件中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM