2017-03-16 95 views
1

安裝win10,安裝了Visual Studio + Xamarin。我創建Xamarin論壇項目,並嘗試在Android上運行:如何在Xamarin上啓動項目?

enter image description here

Серьезность Код Описание Файл Строка Состояние подавления Ошибка error: package android.support.v7.internal.widget.ActivityChooserModel does not exist android.support.v7.internal.widget.ActivityChooserModel.OnChooseActivityListener c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\ActivityChooserModel_OnChooseActivityListenerImplementor.java 8
Ошибка error: package android.support.v7.internal.widget does not exist public boolean onChooseActivity (android.support.v7.internal.widget.ActivityChooserModel p0, android.content.Intent p1) c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\ActivityChooserModel_OnChooseActivityListenerImplementor.java 28
Ошибка error: package android.support.v7.internal.widget does not exist private native boolean n_onChooseActivity (android.support.v7.internal.widget.ActivityChooserModel p0, android.content.Intent p1); c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\ActivityChooserModel_OnChooseActivityListenerImplementor.java 33
Ошибка error: package android.support.v7.internal.widget.FitWindowsViewGroup does not exist android.support.v7.internal.widget.FitWindowsViewGroup.OnFitSystemWindowsListener c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\FitWindowsViewGroup_OnFitSystemWindowsListenerImplementor.java 8
Ошибка error: package android.support.v7.internal.widget.ViewStubCompat does not exist android.support.v7.internal.widget.ViewStubCompat.OnInflateListener c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\ViewStubCompat_OnInflateListenerImplementor.java 8
Ошибка error: package android.support.v7.internal.widget does not exist public void onInflate (android.support.v7.internal.widget.ViewStubCompat p0, android.view.View p1) c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\ViewStubCompat_OnInflateListenerImplementor.java 28
Ошибка error: package android.support.v7.internal.widget does not exist private native void n_onInflate (android.support.v7.internal.widget.ViewStubCompat p0, android.view.View p1); c:\Users\MK\Documents\Visual Studio 2015\Projects\App2\App2\App2.Droid\obj\Debug\android\src\mono\android\support\v7\internal\widget\ViewStubCompat_OnInflateListenerImplementor.java 33
Предупреждение Не найден компонент "System.ObjectModel", на который указывает ссылка.
Предупреждение An unexpected error occurred trying to initialize Android Designer. Please verify the Android SDK path and the Java Development Kit path on Tools->Options->Xamarin->Android Settings menu. Please see the logs for more details. 0

如何正確地開始?

+0

有關Xamarin的相關信息Android JDK Android SDK和JDK的其他用戶指南針對Android SDK和JDK。 Внимательнеечитайрепортыобошибках –

回答

1

我會從處理錯誤的結尾開始: 「錯誤信息嘗試初始化Android設計器時出現意外錯誤請驗證Tools SDK的路徑和Java開發工具包路徑在Tools-> Options-> Xamarin- > Android設置菜單,請參閱日誌以獲取更多詳細信息0「

即檢查(如果需要,請設置)Android SDK路徑和JDK路徑。

在Visual Studio中,它位於工具>選項> Xamarin> Android設置下。我不記得必須設置任何環境/路徑變量,我知道Android Studio曾經需要路徑中的東西,但我認爲Visual Studio/Xamarin沒有要求它們,或者它們已經設置好,所以它沒有需要問。

0

從錯誤日誌中,Xamarin表單包可能沒有完全安裝在您的本地機器上。一些軟件包丟失。要解決此問題,請嘗試以下步驟:

  1. 關閉所有Visual Studio實例。
  2. 重定向到C:\ Users \ UserName \ AppData \ Local \文件夾。
  3. 重命名或刪除Xamarin文件夾
  4. 用VS打開你的解決方案,重建項目。
  5. 等到VS完成下載所有軟件包。這將需要幾分鐘時間取決於您的本地網絡。