简体   繁体   English

Android的VSTS构建定义失败

[英]VSTS Build Definition for Android failing

I'm starting using the build definitions from Team Services for a Xamarin Android App. 我开始将Team Services中的构建定义用于Xamarin Android应用程序。 In Visual Studio everything works fine and I can check in the code to VS Team Services. 在Visual Studio中,一切正常,我可以将代码签入VS Team Services。

UPDATE 1 更新1

Now, at the moment to create an Build Definitions for my project, it's falling. 现在,此刻为我的项目创建一个Build Definitions了。

在此处输入图片说明

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.7198826Z考虑将“ Xamarin.Forms.Xaml,版本= 2.0.0.0,文化=中性,processorArchitecture = MSIL”视为文件名,但它不存在。

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. 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):错误MSB4062:无法从程序集C:\\ a \\ 1 \\ s \\ DentalLife \\加载“ Xamarin.Forms.Build.Tasks.FixedCreateCSharpManifestResourceName”任务。包\\ Xamarin.Forms.2.3.1.114 \\建立\\便携式双赢+ 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. 无法加载文件或程序集'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”或其依赖项之一。 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. 确认声明正确,程序集及其所有依赖项均可用,并且任务包含实现Microsoft.Build.Framework.ITask的公共类。 [C:\\a\\1\\s\\DentalLife\\DentalLife\\DentalLife\\DentalLife.csproj] [C:\\一个\\ 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.7778918Z 2>完成的建筑项目“ C:\\ a \\ 1 \\ s \\ DentalLife \\ DentalLife \\ DentalLife \\ DentalLife.csproj”(默认目标)-失败。

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.7808866Z 1>完成的建筑项目“ C:\\ a \\ 1 \\ s \\ DentalLife \\ DentalLife \\ DentalLife.Droid \\ DentalLife.Droid.csproj”(干净; PackageForAndroid目标)-失败。

2016-10-13T03:30:45.8018852Z 2016-10-13T03:30:45.8018852Z

2016-10-13T03:30:45.8018852Z Build FAILED. 2016-10-13T03:30:45.8018852Z生成失败。

After, a couple of days trying to find any information I found the following stackoverflow links: 之后,几天试图找到任何信息,我发现了以下stackoverflow链接:

  1. Visual Studio Team Services - Build fails, definition wrong? Visual Studio Team Services-构建失败,定义错误?
  2. TFS remains out of sync after Get Sources step 获取源步骤后,TFS仍然不同步

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 更新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. 经过大量尝试并在Internet上查看,我发现问题在于托管代理的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. 然后我发现了这个帖子http://www.blogaboutxamarin.com/xamarin-devops-with-vsts-setup-a-cross-platform-b​​uild-agent-on-windows/在这里我创建了本地代理和Xamarin .Forms版本已更新为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. 但是,我决定在解决方案中将Xamarin.Forms版本升级为2.3.1.114,因为我需要使用该版本中可用的类。 Locally, it builds and run OK. 在本地,它会生成并运行正常。

Now, the problem is again the agent build in VSTS. 现在,问题再次出在VSTS中。 This time is showing me a different error. 这次向我显示了另一个错误。 That there are some dlls that couldn't be found: 找不到一些dll:

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); obj \\ Release \\ android \\ src \\ mono \\ android \\ support \\ v7 \\ internal \\ widget \\ ActivityChooserModel_OnChooseActivityListenerImplementor.java:8:错误:包android.support.v7.internal.widget.ActivityChooserModel不存在obj \\ Release \\ android \\ src \\ mono \\ android \\ support \\ v7 \\ internal \\ widget \\ ActivityChooserModel_OnChooseActivityListenerImplementor.java:33:错误:包android.support.v7.internal.widget不存在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: 在我的Android项目中,我有:

在此处输入图片说明

Finally, this is the link of the GitHub repo where you can find the code: https://github.com/Lesthad/CIXamarinShowTest 最后,这是GitHub存储库的链接,您可以在其中找到代码: https : //github.com/Lesthad/CIXamarinShowTest

Any help would be very appreciate. 任何帮助将不胜感激。 Thanks and sorry for this long post :-( 感谢和对不起,这篇漫长的帖子:-(

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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