InvalidProjectFileException: Cycle in target dependencies detected.Build failed

Here is error message:

/Project/DASSolutionFinder/Droid/DASSolutionFinder.Droid.csproj (Build) ->: error : Error building target _XamarinAndroidBuildAarProguardConfigs: Microsoft.Build.BuildEngine.InvalidProjectFileException: Cycle in target dependencies detected
at Microsoft.Build.BuildEngine.Target.BuildOtherTargets (System.Collections.Generic.IEnumerable1[T] targetNames, System.Action1[T] missing_target, System.Boolean& executeOnErrors) [0x00065] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:263
at Microsoft.Build.BuildEngine.Target.BuildDependencies (System.Boolean& executeOnErrors) [0x0003f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:211
at Microsoft.Build.BuildEngine.Target.BuildActual (System.String built_targets_key, System.Boolean& executeOnErrors) [0x00091] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:177

what should I do ?

Best Answer

Answers

  • LucasJayLucasJay USMember ✭✭

    Got the same one, can't build Android. Tried Stable, beta and Alpha channels...

  • vijaykrvijaykr USUniversity

    @seb987 said:
    Try to downgrade the package Xamarin.Build.Download to version 0.4.5, it worked for me (I had previously version 0.4.6 installed and had the same error).

    Doesn't work even after downgrading the Xamarin.Build.Download to version 0.4.5

  • vijaykrvijaykr USUniversity

    Any other way to solve this issue?

  • Yogi21Yogi21 INMember

    Try to downgrade the package Xamarin.Build.Download to version 0.4.5, it worked for me (I had previously version 0.4.6 installed and had the same error).

    The above solution is not working.

    Any other way to solve this issue?

  • seb987seb987 CHMember

    @vijaykr and @Yogi21 : Are you expecting the same error even after downgrading ? Please provide us your packages.config file's content to help debug your issue.

  • Yogi21Yogi21 INMember

    @seb987

    Please find my package config file. Please help me to sort out this issue.

  • seb987seb987 CHMember

    @Yogi21 : I created a new Xamarin.Forms project with your packages.config and everything is building fine. Have you tried to clean and build your app ? What is your error message now ?

  • Yogi21Yogi21 INMember

    @seb987

    I tried to clean and rebuild the project and also I did deleted bin and obj Folder and tried the same. But the result is same.
    Please find the below error details.

    Error: Error building target _XamarinAndroidBuildAarProguardConfigs: Microsoft.Build.BuildEngine.InvalidProjectFileException: Cycle in target dependencies detected
    at Microsoft.Build.BuildEngine.Target.BuildOtherTargets (System.Collections.Generic.IEnumerable1[T] targetNames, System.Action1[T] missing_target, System.Boolean& executeOnErrors) [0x00065] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:263
    at Microsoft.Build.BuildEngine.Target.BuildDependencies (System.Boolean& executeOnErrors) [0x0003f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:211
    at Microsoft.Build.BuildEngine.Target.BuildActual (System.String built_targets_key, System.Boolean& executeOnErrors) [0x00091] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:177

  • Yogi21Yogi21 INMember

    @Sriman

    Thanks Man. Now Worked I followed point no 1 and tried to rebuild the app and the problem is solved

  • GuillermoZepedaGuillermoZepeda USMember ✭✭

    Downgrade to 0.4.5 worked for me. Thanks!

    I was having issues in Azure Mobile Center after updating the Android project to API 25

  • TedebusTedebus USMember ✭✭

    Downgrade to 0.4.5 worked for me too.
    I don't understand how these things can be possible... :neutral:

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    @DavidOrtinau any comment on it? I also had to downgrade Xamarin.Build.Download from 0.4.6 to 0.4.5, because of this issue.

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai

    Does anyone have a solution which reproduces this issue they could share?

    I'm currently unable to reproduce this on my end, but we've seen it a couple of places and would love to get to the bottom of it.

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai

    Can those of you experiencing this issue please try the pre-release of Xamarin.Build.Download 0.4.7-rc1 which should address the bug.

    https://preview.nuget.org/packages/Xamarin.Build.Download/0.4.7-rc1

  • DenisSugakovDenisSugakov RUMember ✭✭
    edited August 2017

    Looks like it fixed. My project builded with 0.4.7-rc1 successful. I had build error with 0.4.6

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    Same for me - working fine at 0.4.7-rc1 (while there was an issue at 0.4.6) :+1:

  • RyanSappRyanSapp USMember ✭✭

    This is working now, thanks!

  • MichelangeloFrancoMichelangeloFranco ITUniversity ✭✭

    Updated from 0.4.6 to 0.4.7 and it's work

  • Hi All,

    I faced the same issue, In my case after configuring the package to 0.4.5 I was still facing the same issue, I cleaned the project folder, deleted bin and obj folder nothing solved.

    Updated from 0.4.6 to 0.4.7 and it's work. Thanks all

  • starl1nstarl1n DOUniversity ✭✭

    @YogeswaranSivagurunathan said:
    Hi All,

    I faced the same issue, In my case after configuring the package to 0.4.5 I was still facing the same issue, I cleaned the project folder, deleted bin and obj folder nothing solved.

    Updated from 0.4.6 to 0.4.7 and it's work. Thanks all

    This is what solve my issue

  • DanielRobbinsDanielRobbins USMember ✭✭

    @JonathanDick I have a compressed project directory where I can reproduce this, which is using the latest stable Xamarin (as of today.) Also was reproducible with Xamarin from a few days ago (stable channel.)

  • OliverChristenOliverChristen USUniversity ✭✭
    edited January 2018

    I today updated Xamarin.Build.Download from 0.4.5 to 0.4.7 but still get the error above.

    Multidex in Android build options is enabled.

  • ShawnCastrianniShawnCastrianni USBeta ✭✭✭

    I get this error too and I already have 0.4.7 of Xamarin.Build.Download

  • ShawnCastrianniShawnCastrianni USBeta ✭✭✭
    edited January 2018

    I tried several things. I was able to determine that building within Visual Studio for Mac WORKS, but using xbuild on the command line fails. The xbuild command line gives a deprecation warning and says to switch to msbuild. I tried msbuild and it WORKED.

Sign In or Register to comment.