您现在的位置是:首页 > 文章详情

xamarin.forms新建项目android编译错误

日期:2016-08-02点击:574

vs2015 update3 新建的xamarin.forms项目中的android项目编译错误。提示缺少android_m2repository_r22.zip,96659D653BDE0FAEDB818170891F2BB0.zip等类似错误。

Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\classes.jar doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\libs/internal_impl-23.0.1.jar doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\./ doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3\embedded\classes.jar doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3\embedded\./ doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3\embedded\classes.jar doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3\embedded\./ doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\classes.jar doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\libs/internal_impl-23.0.1.jar doesn't exist. XamarinFormsExample.Droid  Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3 directory. XamarinFormsExample.Droid  Error Reason: One or more errors occurred. XamarinFormsExample.Droid Error Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\./ doesn't exist. XamarinFormsExample.Droid
View Code

解决办法

  1. 删除文件夹 C:\Users\your user\AppData\Local\Xamarin
  2. 新建文件夹C:\Users\your user\AppData\Local\Xamarin\zips
  3. 将下载的zip文件copy到zips文件夹,下载地址和文件夹名称关系可参考 http://www.cnblogs.com/qinjin/p/m2repository.html
  4. 清理解决方案,然后重新生成即可

参考

解决Xamarin Android墙的问题

http://stackoverflow.com/questions/36616524/xamarin-support-package-error

http://forums.xamarin.com/discussion/61533/project-wont-build-xamarin-android-support

原文链接:https://yq.aliyun.com/articles/671020
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章