Hi all,
I have an issue with setting up Telerik.UI.for.Xamarin.
I have made all as required in http://docs.telerik.com/devtools/xamarin/controls/calendar/getting-started/calendar-getting-started .
The issue is that I have and exception when starting to debug on emulator:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2056,3): error MSB6006: "java.exe" exited with code 2.
I have changed Java Max Heap Size to 1G and it doesn't help me.
Microsoft Visual Studio Community 2015 Version 14.0.25422.01 Update 3
Microsoft .Net Framework Version 4.6.01586
<package id="Telerik.UI.for.Xamarin.Trial" version="2016.3.1012.3" targetFramework="portable45-net45+win8+wpa81" />
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="portable45-net45+win8+wpa81" />
<package id="Xamarin.Forms.Maps" version="2.3.2.127" targetFramework="portable45-net45+win8+wpa81" />
android:versionName="1.0.0" android:versionCode="7"
Google Play Service Version = 33
Windows 10 Pro 64-bit OS
Maybe I forget something?
I haven't this issue until I have downloaded Telerik and set
[assembly: ExportRenderer( typeof( Telerik.XamarinForms.Input.RadCalendar ), typeof( Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer ) )]
in MainActivity and set
Xamarin.Forms.Forms.Init( this, bundle );
Telerik.XamarinForms.Common.Android.TelerikForms.Init();
Also, MainActivity does inherit FormsAppCompatActivity
public class MainActivity : FormsAppCompatActivity.
Best regard,
Roman Hapatyn
17 Answers, 1 is accepted
That error can happen for a variety of reasons. One of the more popular reasons is that you've surpassed the Davlik 65K limit (due to too many external library references).
The fix for this is usually to enable MultiDex or decrease your external dependencies.
This problem is ultimately is not related to the Telerik UI for Xamarin components but to make sure, I've attached a File > New > TelerikXFApp sample app (all platforms). This is a blank app with just a landing page that is UI for Xamarin enabled. Run the app on your side and confirm you see StartPage.xaml load.
Here is what you need to do to get the attached app running:
1 - Download, extract and open the solution in Visual Studio (if you need to remove any projects you do not have an SDK installed for, like UWP, you can do that now)
2 - Right click on the solution and select Manage Nuget Packages for Solution.
3 - Click the "Restore Packages" button that will appear at the top right in a yellow bar
4 - Once all the packages are restored, right click on the RomanTestApp.Portable project and select Build
5 - Right click on the android project and select "Set as Startup Project" and then select Build
6 - Deploy the app (I have successfully deployed this to an emulator and to the Samsung Galaxy 7 Edge running android 6.0.1.)
A couple tips to make sure that your current project(s) are using UI for Xamarin's requirements:
- System Requirements
- You have the required dependencies for the components
- You have the required Android Support Libraries (important, UI for Xamarin releases are tied to specific versions of Android SDKs and support libraries).
Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress

Do you have the Max Heap size set to 1G? See here for specifics.
Another reason this could be happening is that you're using an Android SDK that we do not yet support. The highest version of the SDK you can compile with is Android 6 (SDK 23), see here for more info on that.
We are planning on adding Android 7 (SDKs 24 and 25) in an upcoming release shortly.
Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress

Hi lance, set Max Heap size to 1G and changed targets but unfortunately same issue.
Using the following:
Compile using android version 6.0 - Check
Multidex enabled - Check
Max Heap size set to 1G - Check
Targeting android version android version 6.0 - Check
Can I ask which version of Xamarin forms should i be using for support with Telerik?
So you can see this first-hand, I've attached a Calendar demo I build just a couple hours ago, also here's a screenshot of my Android SDK Manager.
Note, the demo is using 2017.2.522, your listed version is several releases ago. Are you still using 2016.3.1012? You can get the update from here, it contains a lot of fixes since 2016's releases.
Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress

I have answered you in the following forum post. I hope this solves your issue.
Regards,
Ivaylo Gergov
Telerik by Progress

Hey Lance,
I have the same issue, so I created a brand new blank xamarin forms project, added the Telerik.UI.for.Xamarin from NuGet, set my Android target and compiler to version 6 and set the Heap to 1G.
Still getting the "java.exe" exited with code 2. error on this brand new blank project.
Any ideas?
There is a wide range of reasons for this error, it could be that you've hit the Davlik limit. Enable MultiDex and try again.
I've attached a UI for Xamarin blank application for you to try and build on your side. If you're seeing the error building my demo, then you have an issue with your Java SDK (JDK 1.8) or Android SDK (SDKs/Build Tools/ Platform tools).
Here's a screenshot of my demo project's settings:

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Sorry for the double reply, the last demo I sent you was built targeting Android 7. I've built you another Xamarin.Forms solution, with just the Android project which targets Android 6 (23.3.0), find it attached.
Take following steps:
1 - Rebuild the Portable project first
2 - Rebuild the android project next
I can confirm that it works for me, and
So that you can compare your installed components, here's a couple screenshots from my Android SDK Manager:
Platform tools, Build tools and SDK Platform

EXTRAS

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik

Thanks Lance, I did get it working with heap size and multi-dex, and I can target Oreo and not get any errors with the latest Telerik dll's.
Thanks for all your great posts and responses!

This solved the issue for me!! Thanks
I was stuck for 2 days.

Hi all,
I am having the same issue , VS2019 I just created a brand new application and get the error:
SeverityCodeDescriptionProjectFileLineSuppression State
Error"java.exe" exited with code 2.TelerikXamarinApp1.Android
You now need to enable Multi-dex out of the box. This is because we moved up our minimum version of Xamarin.Forms to 3.6, which has dependencies.
Enable Multi-dex
Take the following steps:
1. Open the Android project's properties window
2. Switch to the Android Options tab
3. Check the "Enable Multi-dex" checkbox
4. Save and rebuild the Android project
Increase Max Heap Size
I would also increase the Max Java heap to 1G
1. Go back to the same properties > Android Options page
2. click the "Advanced" button
3. Enter "1G" into the heap setting.
5. Save and rebuild the Android project.
Regards,
Lance | Technical Support Engineer, Principal
Progress Telerik

Yes that worked.
Thanks.

Hi,
I am having the same issue and I have already set the Heap to 1G, enabled Multidex and targeted android version 6.0..
Do you have any ideas how I can fix this issue?
Hi Martin,
This could be from a wide range of causes (see all the search results here). That error message just means that the java side of things failed at something.
Double check that your SDKs are all at the required min/max versions of all your other dependencies (especially if you just updated something). For Telerik UI for Xamarin, you need API 28.0.0.1 support libraries, see the Required Android Support Libraries documentation.
I don't see a Telerik UI for Xamarin license on your account and this is the first post you've ever had on this account. Are you not using UI for Xamarin and are replying here for general Xamarin support?
- If yes, I recommend reposting on StackOverlflow, in the Xamarin forums or live chat on the Xamarin Slack (use this xamarinchat inviter).
- If not, and you do have a Telerik UI for Xamarin license, please open a Support Ticket here and attach your projects in a ZIP so the team can take a closer look (please delete the bin and obj folders from every project before zipping it up).
Good luck!
Regards,
Lance | Team Lead - US DevTools Support
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.