none
Receiving "An error occurred trying to install required android components" when creating a new blank Xamarin project in VS 2017 enterprise

    Question

  • Hello, I have recently installed VS 2017 with Xamarin.  When I create a new blank project I get the error "An error occurred trying to install required android components"  I will post the full error below.  

    I have tried adding packages and updating everything marked "update available" from the android sdk manager which didn't help.  I have also followed the directions in the error, also didn't help.  I have replaced the named file, which hasn't helped.

    This is for school projects and I really need a environment setup asap, any help would be greatly accepted.  Thanks!

    Full error posting:

    Severity Code Description Project File Line Suppression State
    Error An error occurred trying to install required android components on Project 'HelloWorld_AaronHoppe.Android'.
    Project 'HelloWorld_AaronHoppe.Android' requires the following components installed on your machine: 
    Xamarin.Android.Support.v7.AppCompat
    JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0.aar-23.3.0.0
    AndroidResources: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0.aar-23.3.0.0
    Xamarin.Android.Support.v7.MediaRouter
    JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/mediarouter-v7/23.3.0/mediarouter-v7-23.3.0.aar-23.3.0.0
    JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/mediarouter-v7/23.3.0/mediarouter-v7-23.3.0.aar-23.3.0.0
    AndroidResources: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/mediarouter-v7/23.3.0/mediarouter-v7-23.3.0.aar-23.3.0.0


    Please double-click here to install it.

    Intallation Errors: XA5209 Unzipping failed. Please download 'https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip:m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0.aar' and extract it to the 'C:\Users\Shivai\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded' directory
    XA5209 Reason: The process cannot access the file 'C:\Users\Shivai\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded\res\drawable-xxhdpi-v4' because it is being used by another process.
    XA5207 Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Java library file 'C:\Program Files (x86)\Android\android-sdk\extras\android\classes.jar' doesn't exist.
    XA5207 Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file 'C:\Program Files (x86)\Android\android-sdk\extras\android\classes.jar' doesn't exist.
    XA5207 Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file 'C:\Program Files (x86)\Android\android-sdk\extras\android\libs/internal_impl-23.3.0.jar' doesn't exist. 0

    Tuesday, April 4, 2017 5:36 AM

Answers

  • Hi Shyvai,

    Welcome to MSDN forum.

    According to your error, Use command-line parameters to remove the workload mobile development with .net and then reinstall it. Meanwhile, reinstall android SDK.

    Before you want to create a new Xamarin cross-platform project, please make sure that you have installed the fullowing:

    1.        Install Java Development Kit
    2.        Install Android SDK
    3.        Create an Android virtual device

    By the way, per official docs, Please try the steps to install Xamarin related components.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Shyvai Wednesday, April 5, 2017 10:14 AM
    Wednesday, April 5, 2017 8:46 AM

All replies

  • Hi Shyvai,

    Welcome to MSDN forum.

    According to your error, Use command-line parameters to remove the workload mobile development with .net and then reinstall it. Meanwhile, reinstall android SDK.

    Before you want to create a new Xamarin cross-platform project, please make sure that you have installed the fullowing:

    1.        Install Java Development Kit
    2.        Install Android SDK
    3.        Create an Android virtual device

    By the way, per official docs, Please try the steps to install Xamarin related components.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Shyvai Wednesday, April 5, 2017 10:14 AM
    Wednesday, April 5, 2017 8:46 AM
  • Hello Joyce Yin, and thank you for your response.  I found a link to the official docs earlier and the section in trouble shooting installation errors could have been a fix, though I am not sure.

    What I was worried about was the repositories I downloaded from there didn't match the file structure of my android.support files nor my classmates, whose was working well.  I don't know if this is due to differences with VS 2017 Xamarin android components vs VS 2015 or what.

    The main difference is the the step about loading the files into the embedded folder: "The embedded directory should now contain files such as .jar, .aar, and .pom."  Which conflicts with the embedded folder from our versions which contain the files: aapt, aidl, assets, jni, libs, res, etc. Which is very different from the files from the Xamarin guide.

    Ultimately I gave up and just copied my friends support files that matched my error messages into my Xamarin file.  Which worked.  It is a complete hack of a solution but I was finally able to build projects, so se la vi.

    For most circumstances you answer should work and thank you for taking the time to respond, cheers.

    Aaron

    Wednesday, April 5, 2017 10:13 AM
  • Hi Aaron,

    Glad to know that you have solved it and thank you for sharing the solutions here, which will be helpful for those who has the similar issue with you.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 6, 2017 6:58 AM