Xamarin表示Android问题,包android.support.design。*不存在

时间:2016-03-26 09:19:29

标签: android xamarin xamarin.forms

我有一个Xamarin.Forms项目,其中我无法构建Android,事实上即使是一个全新的项目我也有同样的问题Android失败了大量的错误。我已经安装并重新安装了Android SDK,Java,并确保安装了Android SDK中的所有内容,但仍然没有。

Severity    Code    Description Project File    Line    Suppression State
Error       error: package android.support.design.widget.TabLayout does not exist
        android.support.design.widget.TabLayout.OnTabSelectedListener,  MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   8   
Error       error: package android.support.design.widget.TabLayout does not exist
    public void onTabReselected (android.support.design.widget.TabLayout.Tab p0)    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   76  
Error       error: package android.support.design.widget.TabLayout does not exist
    private native void n_onTabReselected (android.support.design.widget.TabLayout.Tab p0); MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   81  
Error       error: package android.support.design.widget.TabLayout does not exist
    public void onTabSelected (android.support.design.widget.TabLayout.Tab p0)  MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   84  
Error       error: package android.support.design.widget.TabLayout does not exist
    private native void n_onTabSelected (android.support.design.widget.TabLayout.Tab p0);   MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   89  
Error       error: package android.support.design.widget.TabLayout does not exist
    public void onTabUnselected (android.support.design.widget.TabLayout.Tab p0)    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   92  
Error       error: package android.support.design.widget.TabLayout does not exist
    private native void n_onTabUnselected (android.support.design.widget.TabLayout.Tab p0); MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\md5270abb39e60627f0f200893b490a1ade\TabbedPageRenderer.java   97  
Error       error: package android.support.design.widget.AppBarLayout does not exist
        android.support.design.widget.AppBarLayout.OnOffsetChangedListener  MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\AppBarLayout_OnOffsetChangedListenerImplementor.java   8   
Error       error: cannot find symbol
    public void onOffsetChanged (android.support.design.widget.AppBarLayout p0, int p1)
  symbol:   class AppBarLayout
  location: package android.support.design.widget   MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\AppBarLayout_OnOffsetChangedListenerImplementor.java   27  
Error       error: cannot find symbol
    private native void n_onOffsetChanged (android.support.design.widget.AppBarLayout p0, int p1);
  symbol:   class AppBarLayout
  location: package android.support.design.widget   MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\AppBarLayout_OnOffsetChangedListenerImplementor.java   32  
Error       error: package android.support.design.widget.NavigationView does not exist
        android.support.design.widget.NavigationView.OnNavigationItemSelectedListener   MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\NavigationView_OnNavigationItemSelectedListenerImplementor.java    8   
Error       error: package android.support.design.widget.SwipeDismissBehavior does not exist
        android.support.design.widget.SwipeDismissBehavior.OnDismissListener    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\SwipeDismissBehavior_OnDismissListenerImplementor.java 8   
Error       error: package android.support.design.widget.TabLayout does not exist
        android.support.design.widget.TabLayout.OnTabSelectedListener   MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    8   
Error       error: package android.support.design.widget.TabLayout does not exist
    public void onTabReselected (android.support.design.widget.TabLayout.Tab p0)    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    29  
Error       error: package android.support.design.widget.TabLayout does not exist
    private native void n_onTabReselected (android.support.design.widget.TabLayout.Tab p0); MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    34  
Error       error: package android.support.design.widget.TabLayout does not exist
    public void onTabSelected (android.support.design.widget.TabLayout.Tab p0)  MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    37  
Error       error: package android.support.design.widget.TabLayout does not exist
    private native void n_onTabSelected (android.support.design.widget.TabLayout.Tab p0);   MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    42  
Error       error: package android.support.design.widget.TabLayout does not exist
    public void onTabUnselected (android.support.design.widget.TabLayout.Tab p0)    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    45  
Error       error: package android.support.design.widget.TabLayout does not exist
    private native void n_onTabUnselected (android.support.design.widget.TabLayout.Tab p0); MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp.Droid\obj\Debug\android\src\mono\android\support\design\widget\TabLayout_OnTabSelectedListenerImplementor.java    50  
Warning CS0108  'App.Current' hides inherited member 'Application.Current'. Use the new keyword if hiding was intended. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\App.cs    9   
Warning CS0108  'LoginPage.IsBusy' hides inherited member 'Page.IsBusy'. Use the new keyword if hiding was intended.    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\LoginPage.xaml.cs 53  
Warning CS4014  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\LoginPage.xaml.cs 105 
Warning CS4014  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\LoginPage.xaml.cs 112 
Warning CS0649  Field 'LoginServerResponseModel.Login' is never assigned to, and will always have its default value null    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Models\LoginServerResponseModel.cs    8   
Warning CS0649  Field 'RegistrationServerResponseModel.registration' is never assigned to, and will always have its default value null  MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Models\RegistrationServerResponseModel.cs 8   
Warning CS4014  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\SignupPage.xaml.cs    99  
Warning CS4014  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\SignupPage.xaml.cs    150 
Warning CS4014  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\SignupPage.xaml.cs    157 
Warning CS0414  The field 'UploadImagePage.imgcount' is assigned but its value is never used    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\UploadImagePage.xaml.cs   10  
Warning CS0414  The field 'UploadImagePage.userfolder' is assigned but its value is never used  MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\UploadImagePage.xaml.cs   11  
Warning CS4014  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\UploadImagePage.xaml.cs   56  
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\background.png     
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\check_active.png       
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\check_inactive.png     
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\icon_easyrest.png      
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\ic_launcher.png        
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\logout.png     
Warning     @(Content) build action is not supported    MyApp.Droid P:\VisualStudioProjects\MyApp\MyApp\MyApp\Images\pdf_icon.png   

5 个答案:

答案 0 :(得分:4)

尝试在C:\ Users \ UserName \ AppData \ Local \ Xamarin \ Android.Support.Design \ 23.0.1.3(或类似版本号)下备份和删除任何内容,然后构建项目。检查输出窗口,您应该看到一个zip文件的链接以及解压缩的位置。

您可能还必须为其他文件夹执行此操作,例如Android.Support.v7.AppCompat

答案 1 :(得分:4)

我修复此错误的方法是从app项目文件夹中删除obj和bin文件夹并重新重建它。为我工作。

答案 2 :(得分:2)

经过大量的修修补补后,我终于解决了这个问题,继续我做了什么,我将Xamarin更新到最新版本,同时更新VS 2015更新2,完成所有操作后再启动VS我删除了所有用户/username/AppData/Xamarin/Android.Support.*文件夹然后打开VS 2015并创建了一个全新的Xamarin Forms共享项目解决方案,并将其复制到所有需要的文件和Android编译中。

答案 3 :(得分:0)

首先检查它安装的组件android.support.design.Library

在我的情况下,我已经安装了它,之后,我删除了android.support.design.Library的de Component,我再次安装并修复它

答案 4 :(得分:0)

Mac用户

打开终端并输入以下命令:

open ~/.local/share/Xamarin/

在桌面上创建一个“以防万一”文件夹,并将所有内容移出〜/ .local / share / Xamarin / 文件夹。

重建您的应用程序。

您会在控制台上看到这样的消息:

  

/ Users / {username} / Documents / Development / {path .Droid project}:错误XA5209:解压缩失败。请   下载   https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip   并将其提取到   /Users/{username}/.local/share/Xamarin/Xamarin.Android.Support.v4/23.3.0.0/content   目录。 (XA5209)

下载新的.zip文件并将其解压缩到:

open ~/.local/share/Xamarin/Xamarin.Android.Support.v4/23.3.0.0/content

您可能需要为其他文件夹重复此操作。

如果你在PC上,请查看Nigel的answer