1

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.

enter image description here

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 :-(

enter image description here

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:

enter image description here

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 :-(

Community
  • 1
  • 1
MikePR
  • 2,786
  • 5
  • 31
  • 64
  • Is Xamarin.Forms.Build.Tasks.dll existing in that folder? What project template you used? You can provide the detail steps of creating project and add package or share a simple project on the OneDrive. – starian chen-MSFT Oct 13 '16 at 06:47
  • Can you share the entire build logs? You can get it via "Download all logs as zip" button. – Eddie Chen - MSFT Oct 14 '16 at 02:17
  • Based on my test with a simple Android project (new project=>Visual C#=>Android=>Blank App (Android) with Xamarin.Forms package (Install-Package Xamarin.Forms), I cannot reproduce that issue(on-premises build agent and hosted build agent). It's better that you can share a simple project on the OneDrive, we will check it. – starian chen-MSFT Oct 14 '16 at 02:31
  • Can you share a simple project on the OneDrive? – starian chen-MSFT Oct 17 '16 at 06:30
  • Hi @starain, sorry for the delay on this. I was trying to make it work. I updated the original post with the latest information as well as the GitHub link where you can find the code. – MikePR Oct 17 '16 at 23:57
  • I need to check whole build log, you can share it on the OneDrive. – starian chen-MSFT Oct 18 '16 at 05:07
  • To deal with some errors, I modified Android version to Android 6.0 (Marshmallow) of CIXamarinShow.Droid and specify JDK Version to JDK 8 in JDK Option of Build Xamarin.Android step, after that it builds fine on Hosted build agent. – starian chen-MSFT Oct 18 '16 at 05:43
  • Hi again, I tried only downgrading the CIXamarinShow.Droid project target version 6.0 and it's faling either with the hosted or on-premise build. For the JDK, where could I find that option? I tried Right click on the android project -> properties -> build. Is that the correct path? Sorry for the last silly question. – MikePR Oct 18 '16 at 23:38
  • @MikePR You can specify JDK version in Xamarin.Android step of your build definition. – starian chen-MSFT Oct 19 '16 at 11:49
  • Thanks for that. I specified the JDK version to 8 and now it's working on the hosted build agent. Thanks so much :-) – MikePR Oct 20 '16 at 02:41
  • @MikePR Glad to hear that your issue has been solved, I post an answer, you can mark it as answer after 24 hours. – starian chen-MSFT Oct 20 '16 at 08:55

1 Answers1

2

The solution is that you need to specify JDK version in Xamarin.Android step of your build definition.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53