简体   繁体   中英

VSTS Build Definition for Android failing

I'm starting using the build definitions from Team Services for a Xamarin Android App. In Visual Studio everything works fine and I can check in the code to VS Team Services.

UPDATE 1

Now, at the moment to create an Build Definitions for my project, it's falling.

在此处输入图片说明

And this is part of the log:

2016-10-13T03:30:45.7198826Z Considered treating "Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL" as a file name, but it didn't exist.

2016-10-13T03:30:45.7748834Z 2>C:\\a\\1\\s\\DentalLife\\packages\\Xamarin.Forms.2.3.1.114\\build\\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\\Xamarin.Forms.targets(40,3): error MSB4062: The "Xamarin.Forms.Build.Tasks.FixedCreateCSharpManifestResourceName" task could not be loaded from the assembly C:\\a\\1\\s\\DentalLife\\packages\\Xamarin.Forms.2.3.1.114\\build\\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'file:///C:\\a\\1\\s\\DentalLife\\packages\\Xamarin.Forms.2.3.1.114\\build\\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\\Xamarin.Forms.Build.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\\a\\1\\s\\DentalLife\\DentalLife\\DentalLife\\DentalLife.csproj]

2016-10-13T03:30:45.7778918Z 2>Done Building Project "C:\\a\\1\\s\\DentalLife\\DentalLife\\DentalLife\\DentalLife.csproj" (default targets) -- FAILED.

2016-10-13T03:30:45.7808866Z 1>Done Building Project "C:\\a\\1\\s\\DentalLife\\DentalLife\\DentalLife.Droid\\DentalLife.Droid.csproj" (clean;PackageForAndroid target(s)) -- FAILED.

2016-10-13T03:30:45.8018852Z

2016-10-13T03:30:45.8018852Z Build FAILED.

After, a couple of days trying to find any information I found the following stackoverflow links:

  1. Visual Studio Team Services - Build fails, definition wrong?
  2. TFS remains out of sync after Get Sources step

Basically, in those post they mention that this could be a security related issue.

I tried following all suggestion from changing the permissions to changing some parameters like the Build job authorization scope. But any luck so far :-(

在此处输入图片说明

UPDATE 2

After a lot of attempts and looking on Internet, I found that te problem was the hosted agent had a different version for Xamarin.Froms. Then I found this post http://www.blogaboutxamarin.com/xamarin-devops-with-vsts-setup-a-cross-platform-build-agent-on-windows/ where I created a on-premise agent and the Xamarin.Forms version got updated to be 6.1.1. After that I was able to queue a build ALL in Green :-)

However, I decided to upgrade the Xamarin.Forms version to be 2.3.1.114 in my Solution, because I needed to use a class that is available in that version. Locally, it builds and run OK.

Now, the problem is again the agent build in VSTS. This time is showing me a different error. That there are some dlls that couldn't be found:

obj\\Release\\android\\src\\mono\\android\\support\\v7\\internal\\widget\\ActivityChooserModel_OnChooseActivityListenerImplementor.java:8: error: package android.support.v7.internal.widget.ActivityChooserModel does not exist obj\\Release\\android\\src\\mono\\android\\support\\v7\\internal\\widget\\ActivityChooserModel_OnChooseActivityListenerImplementor.java:33: error: package android.support.v7.internal.widget does not exist 2016-10-17T02:26:08.1053649Z private native boolean n_onChooseActivity (android.support.v7.internal.widget.ActivityChooserModel p0, android.content.Intent p1);

In my Android project I have:

在此处输入图片说明

Finally, this is the link of the GitHub repo where you can find the code: https://github.com/Lesthad/CIXamarinShowTest

Any help would be very appreciate. Thanks and sorry for this long post :-(

解决方案是您需要在构建定义的Xamarin.Android步骤中指定JDK版本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM