Visual Studio Xamarin編譯Android項目出錯的解決辦法

安裝完Xamarin後,編譯Android項目時,你會發現好長時間進度都不動,當你取消編譯後,會發現其實是出錯了,就是因在Android項目在第一次編譯時要去google網站上下一個andorid sdk包,牆內又連不上,就卡在那了,解決辦法就是自已到國內的一些鏡像網站上(如:http://mirrors.opencas.cn/android/)下一個,如:android_m2repository_r29.zip, 然後解壓到任意目錄下,用mklink建立鏈接到C:\Users\{username}\AppData\Local\Xamarin\Android.Support.v4\23.3.0.0目錄下,名字叫content,如命今:

cd Android.Support.Animated.Vector.Drawable\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.Design\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.v4\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.v7.AppCompat\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.v7.CardView\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.v7.MediaRouter\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.v7.RecyclerView\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.Vector.Drawable\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

cd Android.Support.Animated.Vector.Drawable\23.3.0.0
rmdir content
mklink /j content ..\..\android_m2repository_r29
cd ..\..\

這樣再回到VS中編譯,就OK了。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章