"java.exe" exited with code 2

2 posts, 0 answers
  1. Roman
    Roman avatar
    1 posts
    Member since:
    Oct 2016

    Posted 24 Oct 2016 Link to this post

    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="" targetFramework="portable45-net45+win8+wpa81" />
    <package id="Xamarin.Forms.Maps" version="" 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 );

    Also, MainActivity does inherit FormsAppCompatActivity
    public class MainActivity : FormsAppCompatActivity.

    Best regard,
    Roman Hapatyn

  2. Lance | Tech Support Engineer, Sr.
    Lance | Tech Support Engineer, Sr. avatar
    283 posts

    Posted 24 Oct 2016 Link to this post

    Hello Roman,

    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).

    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top