示例Xamarin项目在VSTS中构建失败

时间:2016-10-31 14:40:44

标签: xamarin msbuild xamarin.android azure-devops

我正在尝试使用VSTS构建这个https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-xamarin-android-get-started/项目。签入代码,使用默认构建配置。但由于未知原因,它失败了。似乎所有代码和程序集都已下载:

...
2016-10-31T14:31:13.1891941Z C:\a\1\s\FirstXamarinApp\packages\SQLitePCLRaw.provider.e_sqlite3.android.1.1.0\lib\MonoAndroid:
2016-10-31T14:31:13.1891941Z Getting SQLitePCLRaw.provider.e_sqlite3.dll
2016-10-31T14:31:13.9442737Z ##[section]Finishing: Get Sources
2016-10-31T14:31:13.9462739Z ##[section]Starting: Xamarin component restore $/Mobile Playground/FirstXamarinApp
2016-10-31T14:31:13.9732734Z ==============================================================================
2016-10-31T14:31:13.9732734Z Task         : Xamarin Component Restore
2016-10-31T14:31:13.9732734Z Description  : Restores Xamarin components for the specified solution
2016-10-31T14:31:13.9732734Z Version      : 0.1.8
2016-10-31T14:31:13.9732734Z Author       : Microsoft Corporation
2016-10-31T14:31:13.9732734Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=786653)
2016-10-31T14:31:13.9732734Z ==============================================================================
2016-10-31T14:31:14.7788257Z [command]C:\a\_tasks\XamarinComponentRestore_ff50fc97-da8c-4683-b014-34c15315ee5f\0.1.8\xpkg\xamarin-component.exe restore -u [removed] -p [removed] C:/a/1/s/FirstXamarinApp
2016-10-31T14:31:15.0028479Z INFO (restore): Computed cookie jar path: C:\Users\buildguest\.xamarin-credentials
2016-10-31T14:31:16.2730908Z INFO (login): Computed cookie jar path: C:\Users\buildguest\.xamarin-credentials
2016-10-31T14:31:16.2800907Z INFO (login): Computed cookie jar path: C:\Users\buildguest\.xamarin-credentials
2016-10-31T14:31:16.2800907Z INFO (login): Credentials successfully stored.
2016-10-31T14:31:16.2830906Z ERROR (login): C:/a/1/s/FirstXamarinApp does not exist.
2016-10-31T14:31:16.2970912Z ##[error]xamarin-component.exe failed with error: C:\a\_tasks\XamarinComponentRestore_ff50fc97-da8c-4683-b014-34c15315ee5f\0.1.8\xpkg\xamarin-component.exe failed with return code: 1
2016-10-31T14:31:16.2970912Z ##[error]xamarin-component.exe failed with error: C:\a\_tasks\XamarinComponentRestore_ff50fc97-da8c-4683-b014-34c15315ee5f\0.1.8\xpkg\xamarin-component.exe failed with return code: 1
2016-10-31T14:31:16.3030909Z ##[section]Finishing: Xamarin component restore $/Mobile Playground/FirstXamarinApp
2016-10-31T14:31:16.3030909Z ##[section]Starting: Publish Artifact: drop
2016-10-31T14:31:16.3050910Z ==============================================================================
2016-10-31T14:31:16.3050910Z Task         : Publish Build Artifacts
2016-10-31T14:31:16.3050910Z Description  : Publish Build artifacts to the server or a file share
2016-10-31T14:31:16.3050910Z Version      : 1.0.38
2016-10-31T14:31:16.3050910Z Author       : Microsoft Corporation
2016-10-31T14:31:16.3050910Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
2016-10-31T14:31:16.3050910Z ==============================================================================
2016-10-31T14:31:16.4940955Z ##[error]Publish build artifacts failed with error: Not found PathtoPublish: C:\a\1\b\Release
2016-10-31T14:31:16.4980941Z ##[section]Finishing: Publish Artifact: drop
2016-10-31T14:31:16.4990982Z ##[section]Starting: Post Job Cleanup
2016-10-31T14:31:16.5110937Z ##[section]Finishing: Post Job Cleanup
2016-10-31T14:31:16.5110937Z ##[section]Finishing: Build

对我而言,似乎所有内容都下载到c:\ a \ 1 \ s。但后来,错误被抛出

  

错误(登录):C:/ a / 1 / s / FirstXamarinApp不存在。

'\'已被'/'取代。这可能是原因吗?

我没有对构建步骤做任何特别的事情。刚刚引用了解决方案文件,项目文件,为Xamarin添加了用户名和密码,并将Java设置为版本8而不是自定义。

在Visual Studio中,项目构建得很好。

2 个答案:

答案 0 :(得分:0)

根据您的日志,您在解决方案路径中指定了文件夹路径$/Mobile Playground/FirstXamarinApp。如果我指定了如下截图的文件夹路径,我可以重现您的问题:

enter image description here

  

要解决此问题,您需要指定解决方案路径   截图如下:

enter image description here

答案 1 :(得分:0)

似乎变量" Project"最初设置为" $ / Mobile Playground / FirstXamarinApp / playground / playground.csproj"是问题的原因。当更改为" ** / playground.csproj"时,构建继续。