"java.exe" exited with code 2

8 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="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

  2. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    347 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).

    Regards,
    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
  3. Leonard
    Leonard avatar
    6 posts
    Member since:
    May 2017

    Posted 22 May Link to this post

    Hi I am having an issue with a the same message, "java.exe" exited with code 2, however I am not having an issue when I am using some single packages such as dataVisualization.trial and skiasharp.trial for the gauge component but when I try to install all the telerik packages I get the same exception, since I have a current working project I wont use another sample project but would like to get my existing project working with telerik also I have enabled multidex and i get the same error happening so i am afraid to have run out of options on this one...??
  4. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    347 posts

    Posted 22 May Link to this post

    Hi Roman,

    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
    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
  5. Leonard
    Leonard avatar
    6 posts
    Member since:
    May 2017

    Posted 22 May in reply to Lance | Tech Support Engineer, Sr. Link to this post

    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?

  6. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    347 posts

    Posted 22 May Link to this post

    Hi Roman,

    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
    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
  7. Leonard
    Leonard avatar
    6 posts
    Member since:
    May 2017

    Posted 22 May in reply to Lance | Tech Support Engineer, Sr. Link to this post

    Hi lance, I am not Roman, and I am a new member in this thread, I am using 2017.2.522 as well
  8. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    690 posts

    Posted 23 May Link to this post

    Hi Leonard,

    I have answered you in the following forum post. I hope this solves your issue.

    Regards,
    Ivaylo Gergov
    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