Forum Xamarin.Forms

"ResolveLibraryProjectImports" - Microsoft App Center Build

Daxton47Daxton47 Member ✭✭

I recognize the community is probably sick and tired of seeing this error, but we can't find a solution! Our app is ready for deployment on Android and iOS. We are using Microsoft's App Center for deployment, using Github as the source. The iOS builds just fine, it is currently deployed to real devices. Android, however, breaks with the "ResolveLibraryProjectImports" error. Here is some of the build output. Any help would be appreciated! As a side note, the app builds just fine in debug mode on both emulated devices, and usb connected devices (Android and iOS).

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018: The "ResolveLibraryProjectImports" task failed unexpectedly. [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/obj/Release/lp/0'. [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x000f7] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) [0x00006] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.FileSystemEnumerableIterator`1[TSource].CommonInit () [0x00054] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.FileSystemEnumerableIterator`1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler`1[TSource] resultHandler, System.Boolean checkHost) [0x000d6] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00009] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.Directory.EnumerateFileSystemNames (System.String path, System.String searchPattern, System.IO.SearchOption searchOption, System.Boolean includeFiles, System.Boolean includeDirs) [0x00000] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.Directory.InternalEnumerateFiles (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) [0x00000] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at System.IO.Directory.EnumerateFiles (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) [0x00038] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res, System.Collections.Generic.ICollection`1[T] jars, System.Collections.Generic.ICollection`1[T] resolvedResourceDirectories, System.Collections.Generic.ICollection`1[T] resolvedAssetDirectories, System.Collections.Generic.ICollection`1[T] resolvedEnvironments) [0x001ed] in <96027da06dd5411688a31011072e256f>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute () [0x000fa] in <96027da06dd5411688a31011072e256f>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in <61115f75067146fab35b10183e6ee379>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1193,2): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00212] in <61115f75067146fab35b10183e6ee379>:0  [/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj]
Done Building Project "/Users/vsts/agent/2.134.2/work/1/s/EXSMobile.Android/EXSMobile.Android.csproj" (PackageForAndroid target(s)) -- FAILED.

Build FAILED.

Best Answers

  • Daxton47Daxton47 Member ✭✭
    Accepted Answer

    @YorkGo

    Yeah, we have been in communication, we discovered today that it is a Xamarin issue. The git is being cloned for App Center use, and the cloned Android project throws this ridiculous error. Cleaning and rebuilding the cloned project fixes the error. Definitely annoying though. Thanks for the pointer!

Answers

  • omarantonio16omarantonio16 Member ✭✭
    edited July 2018

    I know it is annoying, I have used a series of steps and it works correctly, in fact, I had to fix that error a while ago because I appeared after updating the visual studio:

    1. Clean and recompile the entire solution.

    2. Clean and recompile each solution one by one.

    3. Close visual studio and reopen it. Repeat the first point.

    4. Delete the .bin and .obj file of each project, then recompile the solution.

    5. If none of the above works, return to a stable version.

    6. Verify in the package manager of nugets all the projects have the same version of xamarin.forms; in case they are not equal, install the same version in all projects, clean and recompile, and if you mark error, close and open visual studio.

    I do not have the slightest idea why these errors occur, sometimes they appear out of nowhere, it's something unstable, and I do not even talk when there's a visual studio update.

    PS: never update the appcompat packages and all those types of android packages, I one day mistakenly install them and I stop working the project :(.

  • Daxton47Daxton47 Member ✭✭

    Definitely agreed that updating Xamarin packages can be risky business. Unfortunately, I have tried the above steps countless times, but nothing has worked. It makes you wonder if Xamarin apps have ever actually been successful? The entire experience has been an uphill battle. Of course it couldn't see me out the door by simply building to Microsoft's Appstore, no, it has to make even that simple process more complicated than it needs to be. Though Xamarin.Forms at times can be useful, the time wasted on stupid bugs has completely contradicted it's claims to efficiency. But whatever! Thanks for the help.

  • Daxton47Daxton47 Member ✭✭
    Accepted Answer

    @YorkGo

    Yeah, we have been in communication, we discovered today that it is a Xamarin issue. The git is being cloned for App Center use, and the cloned Android project throws this ridiculous error. Cleaning and rebuilding the cloned project fixes the error. Definitely annoying though. Thanks for the pointer!

Sign In or Register to comment.