1
votes

Installed win10, installed Visual Studio + Xamarin. I create Xamarin Forums project and try to run on android:

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

How correctly to start?

3
Похоже что Xamarin не может найти Android JDK В настройках нужно указать путь к Android SDK и JDK. Внимательнее читай репорты об ошибкахDanil Kurkin

3 Answers

1
votes

I can't read the errors properly but it looks like you are missing packages?

Have you followed all the steps on the Xamarin Android setup guide?

1
votes

I'd start by addressing the end of your error: "Предупреждение 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"

namely, check (set if needed) the Android SDK path and the JDK path.

In Visual Studio this is under Tools > Options > Xamarin > Android Settings. I don't recall having to set any environment/path variables, I know Android Studio used to need things in the path but I think Visual Studio/Xamarin didn't ask for them, or maybe they were already set so it didn't need to ask.

0
votes

From the error log, Xamarin forms packages may not be fully installed in your local machine. Some packages are missing. To resolve this problem, please try the following steps:

  1. Close all Visual Studio instances.
  2. Redirect to C:\Users\UserName\AppData\Local\ folder.
  3. Rename or delete Xamarin folder
  4. Open your solution with VS, rebuild the project.
  5. Wait until VS finish downloading all the packages. It will take a few minutes depending on your local Net.