Have you or someone you know been physically harmed or emotionally scarred by the stress of setting up Continuous Integration on VSTS for your Xamarin.Android project? If your answer is yes, you are entitled to no compensation, but this blog post might help.
Easily one of the most frustrating experiences I’ve had with CI so far. It seemed that after I worked through one issue breaking the build, another two popped up. It’s like fighting the Hydra of builds.
Of course everything built fine on my local machine as well as on my other developers’ machines! So WTF VSTS???
Let’s look at some common errors you might have run into. If none of these cover your problems, leave a comment and we can try to sort it out after.
“Major version 51 is newer than 50, the highest major version supported by this compiler.”
Maybe you’ve run into this problem during your actual builds in the past. Basically the issue is that the latest Android Support Libraries build with a newer version of the compiler. The fix is simple – in VSTS, set your JDK version explicitly to 8.
- In your build definition, go to your Build Xamarin.Android project step
- Scroll down the the JDK options section
- Select JDK Version
- Select JDK 8 from the JDK Version dropdown
- Save
- Run
“java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize)”
The error is at least pretty explanatory. You ran out of memory in your Java Heap.
The solution is to increase your Java Heap explicitly:
- In your IDE (VS or XS), go to your Android project
- Open the properties for your project
- Set your configuration to Release (or whatever configuration your VSTS build runs as)
- Go to the Android Options Tab
- Go to the Advanced tab
- Go down to the Advanced Android Build Settings
- Set the Java Max Heap Size to something larger such as “1G”
These errors can be common and are only applicable to basic Android builds. This does not cover Continuous Deployment to services such as HockeyApp or Visual Studio Mobile Center.
Don’t forget to leave a comment if you’ve run into any different issues!
Hi alex,
I have a new error for you !
My solution contain a project with a binded library from a jar. The project compile correctly on my computer but on vsts somme error are found in generated c# files… I don’t think this files are used in my project and I didn’t find yet how to exclude this files…
LikeLike
Hmmmm can you send me the error messages and logs from vsts? I might know what’s going on, but I need some more detail!
LikeLike
Here they are :
8 errors on my linked project :
“F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\myproj.Mobile.Android.ScanIdentityCard.csproj” (default target) (1) ->
(CoreCompile target) ->
obj\Release Android\generated\src\Org.Jmrtd.Cert.CVCertificateFactorySpi.cs(9,23): error CS0534: ‘CVCertificateFactorySpi’ does not implement inherited abstract member ‘CertificateFactorySpi.EngineGenerateCRLs(Stream)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Org.Jmrtd.Cert.CVCertificateFactorySpi.cs(9,23): error CS0534: ‘CVCertificateFactorySpi’ does not implement inherited abstract member ‘CertificateFactorySpi.EngineGenerateCertificates(Stream)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Org.Jmrtd.Cert.KeyStoreCertStoreSpi.cs(9,23): error CS0534: ‘KeyStoreCertStoreSpi’ does not implement inherited abstract member ‘CertStoreSpi.EngineGetCRLs(ICRLSelector)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Org.Jmrtd.Cert.KeyStoreCertStoreSpi.cs(9,23): error CS0534: ‘KeyStoreCertStoreSpi’ does not implement inherited abstract member ‘CertStoreSpi.EngineGetCertificates(ICertSelector)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Org.Jmrtd.Cert.PKDCertStoreSpi.cs(9,23): error CS0534: ‘PKDCertStoreSpi’ does not implement inherited abstract member ‘CertStoreSpi.EngineGetCRLs(ICRLSelector)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Org.Jmrtd.Cert.PKDCertStoreSpi.cs(9,23): error CS0534: ‘PKDCertStoreSpi’ does not implement inherited abstract member ‘CertStoreSpi.EngineGetCertificates(ICertSelector)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Noconflict.Org.Ejbca.Cvc.JDKCVCertificateFactory.cs(9,23): error CS0534: ‘JDKCVCertificateFactory’ does not implement inherited abstract member ‘CertificateFactorySpi.EngineGenerateCRLs(Stream)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
obj\Release Android\generated\src\Noconflict.Org.Ejbca.Cvc.JDKCVCertificateFactory.cs(9,23): error CS0534: ‘JDKCVCertificateFactory’ does not implement inherited abstract member ‘CertificateFactorySpi.EngineGenerateCertificates(Stream)’ [F:\Agent1\_work\80\s\myproj.Mobile.Android.ScanIdentityCard\Fols.Mobile.Android.ScanIdentityCard.csproj]
8 Error(s)
##[error]Process ‘msbuild.exe’ exited with code ‘1’.
##[section]Finishing: Build Xamarin.Android Fols.Mobile.Android.csproj
LikeLike
What are your exact builds steps in your VSTS build? I think there might be a missing step or something.
LikeLike
They are theses :
GetSources OK
Nuget Restore OK
xamarin Componenet Restore OK
Buid xamarin proj KO
ms build 15.0 x86
jdk default x86
LikeLike
I tried to modify jdk version, ms build version… without any improovement.
I’m going to export my binded library as a dll, that should exclude its code from vsts build and allow me to continue my CI…
LikeLike