AAPT error Unknown option '--no-version-vectors

I have recently updated support library to 23.2.1 beta 1. After updating I started getting the following error "Unknown option '--no-version-vectors'". Anybody have any idea, how to fix it?

I have got a blog post regarding the library 23.2 which is related to Android Studio, it says
"// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
} "

Please find the link here

But I am not sure how to use this option in Xamarin.

Tagged:

Best Answers

Answers

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai
    Accepted Answer

    @AjuVidyadharan you need to make sure you have the Android SDK Build-Tools version 23.0.0 or higher installed, and additionally, make sure older versions are uninstalled (some versions of Xamarin.Android will prefer an older version even if the newer one is installed).

    This error will be more clear in an upcoming version of the bindings.

  • AjuVidyadharanAjuVidyadharan USMember ✭✭

    @JonathanDick I tried your solution, but it's not working. Still I am getting the same error.

  • TonyDTonyD USMember ✭✭✭

    I upgraded to 23.0.3 (and removed the old ones) but now I get hundreds of errors in the Resource.designer.cs file. I tried deleting everything multiple times but it seems to get regenerated incorrectly. Any ideas?

  • AlexanderOsokinAlexanderOsokin USMember ✭✭

    @JonathanDick said:
    @AjuVidyadharan you need to make sure you have the Android SDK Build-Tools version 23.0.0 or higher installed, and additionally, make sure older versions are uninstalled (some versions of Xamarin.Android will prefer an older version even if the newer one is installed).

    not helped(

  • AjuVidyadharanAjuVidyadharan USMember ✭✭

    I resolved my problem by updating SDK Build-Tools as well as Xamarin Studio to latest.

  • AlexanderOsokinAlexanderOsokin USMember ✭✭

    @AjuVidyadharan said:
    I resolved my problem by updating SDK Build-Tools as well as Xamarin Studio to latest.

    Xamarin Studio 5.10.3 (build 51) - latest stable
    SDK Build-Tools 23.0.3 - latest

    Older build tools was deleted.

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Tool exited with code: 2. Output: ERROR: Unknown option '--no-version-vectors--no-version-vectors'

  • Shane000Shane000 USMember ✭✭✭

    @TomCurran said:
    @AjuVidyadharan @JonathanDick

    To solve this error I manually added the build tools version to android csproj using AndroidSdkBuildToolsVersion. I didn't want to uninstall old versions of build tools as other projects & libraries depend on those.

    https://developer.xamarin.com/guides/android/under_the_hood/build_process/#AndroidSdkBuildToolsVersion

    I did this and it works but I'm now going to have to constantly remember to update it to latest every time I update my android SDKs. Fun.

  • AlexanderOsokinAlexanderOsokin USMember ✭✭
    edited May 2016

    @JonathanDick

    Support Design 23.3.0
    Xamarin.Android 6.0.3.5
    Xamarin Studio 5.10.3 (51)
    SDK Build-tool 23.0.3

    Build started 5/10/2016 10:17:56 AM.
        Target _ResolveMonoAndroidSdks:
            MonoAndroid Tools: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/
            MonoAndroid Binaries: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/
            Android Platform API level: 23
            TargetFrameworkVersion: v6.0
            Android NDK: /Users/mobiledevmac1/Library/Developer/Xamarin/android-ndk/android-ndk-r8d/
            Android SDK: /Users/mobiledevmac1/Library/Developer/Xamarin/android-sdk-mac_x86/
            Android SDK Build Tools: /Users/mobiledevmac1/Library/Developer/Xamarin/android-sdk-mac_x86/build-tools/23.0.3/
            Java SDK: /usr/
    
        Target PrepareForBuild:
            Configuration: Debug Platform: AnyCPU
    
        Target _GenerateAndroidAssetsDir:
        No output files were specified for target _GenerateAndroidAssetsDir, skipping.
    
        Target _ComputeAndroidResourcePaths:
            Created directory "obj/Debug/res/"
    
        Target _ValidateAndroidPackageProperties:
              PackageName: MaterialEditText.MaterialEditText
    
        Target _GenerateAndroidResourceDir:
    ....
    
        Target VectorDrawableCheckBuildToolsVersionTask:
            Checking Android SDK Build-tools version...
            Selected Android SDK Build Tools Path: /Users/mobiledevmac1/Library/Developer/Xamarin/android-sdk-mac_x86/build-tools/23.0.3/
            Selected Android SDK Build Tools Version: 23.0.3
            Android SDK Build Tools Version: 23.0.3 meets minimum requirements for Vector Drawables. OK.
            Finished Checking Android SDK Build-tools version.
    
        Target _UpdateAndroidResgen:
              Processing: obj/Debug/res/values/attrs.xml
              Processing: obj/Debug/res/values/dimens.xml
              Processing: obj/Debug/res/values/strings.xml
            Tool /Users/mobiledevmac1/Library/Developer/Xamarin/android-sdk-mac_x86/build-tools/23.0.3/aapt execution started with arguments: package -f -m -M 
    ...
    /Users/mobiledevmac1/Library/Developer/Xamarin/android-sdk-mac_x86/platforms/android-23/android.jar --auto-add-overlay --no-version-vectors--no-version-vectors 
            ERROR: Unknown option '--no-version-vectors--no-version-vectors'
            Android Asset Packaging Tool
    
  • rb555rb555 USUniversity

    @JonathanDick said:
    @AjuVidyadharan you need to make sure you have the Android SDK Build-Tools version 23.0.0 or higher installed, and additionally, make sure older versions are uninstalled (some versions of Xamarin.Android will prefer an older version even if the newer one is installed).

    This error will be more clear in an upcoming version of the bindings.

    This solution worked for me. Thanks Jonathan.

  • DanielArayaDanielAraya DEMember ✭✭

    @AjuVidyadharan Would you mind sharing how/where exactly you added that aapt option?

  • BuildCalcBuildCalc USMember ✭✭✭

    @AlexanderOsokin - Thank you! That was the real issue. In my case, this issue just appeared (there were no SDK or IDE updates that preceded the problem).

  • Tom_RedoxTom_Redox GBMember

    @AlexanderOsokin big thanks from me too, that was exactly what my problem was

  • jack.lejack.le USUniversity

    @AlexanderOsokin said:
    Ok, finally, I found the problem.
    In .csproj was 2 duplicate lines. Removing first line solves the problem.
    <Import Project="..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\build\Xamarin.Android.Support.Vector.Drawable.targets')" /> <Import Project="..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />

    Thank you so much. You saved my day.

  • ProgrammerCMRProgrammerCMR USMember ✭✭
    @AlexanderOsokin said:
    Ok, finally, I found the problem.
    In .csproj was 2 duplicate lines. Removing first line solves the problem.
    
    <Import Project="..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
        <Import Project="..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
    

    />

    thanks, this worked for me

  • ErikHemlerErikHemler USUniversity

    @AlexanderOsokin said:
    Ok, finally, I found the problem.
    In .csproj was 2 duplicate lines. Removing first line solves the problem.
    <Import Project="..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\build\Xamarin.Android.Support.Vector.Drawable.targets')" /> <Import Project="..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />

    This worked for me as well. Thanks!

  • SumitmPathakSumitmPathak USMember ✭✭
    edited November 2016

    @AlexanderOsokin said:
    Ok, finally, I found the problem.
    In .csproj was 2 duplicate lines. Removing line solves the problem.

    Thanks this works for me

  • MornaTironaMornaTirona USUniversity

    Alexander Osokin's solution with the duplicate line in the .csproj file worked for me.

  • MikeJones.0740MikeJones.0740 USMember

    FYI, once you have targeted API 24 (and support library v24.x), you need to make sure that you're using v24 of build tools, too.

Sign In or Register to comment.