java.exe exited with code 1 (Xamarin.Android.Common.targets)

2»

Posts

  • Emixam23Emixam23 USMember ✭✭✭

    There is no proguard in Mac OS (Sierra)

  • VahidMazloomiVahidMazloomi USMember ✭✭

    @Arvindraja said:
    The Perfect Solution for me

    downloaded the proguard file and unzip it

    url to download file
    https://sourceforge.net/projects/proguard/files/proguard/4.6/

    go to this location:
    C:\Users\yourUsername\AppData\Local\Android\android-sdk\tools
    here you will find proguard folder rename it to proguard.old

    and paste the downloaded unzip folder(folder with name proguard) there inside the tools folder.
    rebuilt and run project,

    after doing this if you won't get the solution do the last step also
    last step is:
    open the proguard.old folder copy all files from here and paste in the proguard folder(skip the same files if you get the warning)

    Note :Everything you need to do inside this location only
    C:\Users\yourUsername\AppData\Local\Android\android-sdk\tools

    hope it help you :)

    The proguard 4.6 did not work for me. But I download the 5.3.3 it works perfect.

  • Tried to apply all that solution but i still cant build, pls help :disappointed:

  • batmacibatmaci DEMember ✭✭✭✭✭

    This occurs also if one of the googleplayservice package has older version than others. I had recognized that my GCM library was old and after updating, it fixed the problem

  • ObrazcoffObrazcoff USMember

    @ArthurDent said:
    I tried all the suggestions I found around the web such as deleting the bin and obj directories, remaking the solution file, re-pulling the entire solution from the source-code repository, etc. etc... but none of these worked in my case.

    Then I tried updating my Java installation, and in my case that fixed it.

    Same for me - update of Java helped.

  • PavlickPavlick USMember ✭✭
    • Upgrading to next Android SDK (from 25 to 26) and having it as a target in project options helped in my case.
  • AlexandruGHAlexandruGH Member ✭✭

    I must mention that before I wrote this post I tried the following things:

    updated java version and sdk to the latest java 8 version
    Updated Proguard to the latest version available
    I created a proguard configuration file and set it up correspondingly, excluding some google libraries that are well knows to cause problems
    Changed the targeted Android project version to Android 8 and set the minimum at 5
    Tried to set different parameters for java heap size, like 1G, 2G
    

    I have one error and somewhere around 200 warnings.
    The error is the one described in the title and most of the warnings refer to library versions that are a bit old or obsolete.
    There are also 3 or 4 warnings that are longer in size and harder to understand, but the project runs without proguard option activated.
    Should I always aim for 0 warnings and this might be a problem?

    I mention that I have a MAC with the latest updates on the OS and I'm using Visual Studio Community 2017. The project is Xamarin.Forms with PCL.
    Any help is welcomed!

  • AlexandruGHAlexandruGH Member ✭✭

    It turned out that this proguard.conf file solved the problem:

    -dontwarn okio.**
    -keep class okio.** { *; }
    -keepattributes Signature
    -keepattributes Exceptions

  • PrinceTegatonPrinceTegaton USMember ✭✭
    edited February 2018

    @Korayem said:
    Create file named proguard.cfg inside Android project in the solution. Right click and set Build Action to ProguardConfig.

    Add the following lines:

    -keep class com.google.android.gms.** { *; }
    -dontwarn com.google.android.gms.**
    

    Amend the above according to type of errors you're getting

    Make sure you save file as UTF-8 and NOT UTF-8 BOM

    worked for me after 3 days of deleting and updating what had no problem. But my apk file size is still same... any suggestion?

  • MehdiDehghaniMehdiDehghani USMember ✭✭

    Hi,

    The proguard page doesn't open for me (500 error code), what the hell happened?
    I also have same error and I tired all options (but updating proguard), any idea how to fix this error?

  • SheemuSheemu USMember ✭✭

    I was facing this issue on the last few days I had to resolve it by unchecking Enable ProGuard because it was caused by 2 project references I had "Mono.Android.GoogleMaps and Mono.Android.Support.v13".

  • NickKovalskyNickKovalsky USMember ✭✭✭

    This problem was with me forever until i did both things (thanks everyone above):
    1 uninstalled api 23 everything from android sdk
    2 included proguard.cfg in android project with build action ProguardConfiguration, encoding Unicode (UTF-8 without signature) - Codepage 65001

    with inside text

    -keep public class com.google.android.gms.* { public *; }
    -dontwarn com.google.android.gms.**
    -dontwarn com.onesignal.**

  • NickKovalskyNickKovalsky USMember ✭✭✭

    Also had to apply this solution after built release with proguard was crashing: https://stackoverflow.com/a/37738553/7149454

  • MichaelLantMichaelLant CAMember ✭✭
    edited February 10

    It looks like the ProGuard problem is well, still a problem. It took a long time for me to sort out the build issue and even though this is an old thread, it's reference to ProGuard being the culprit remains true. It seems that ProGuard doesn't like Xamarin.Forms.GoogleMaps and was removing the Maps references.

  • In fact, this problem is solved very easily, you only need to create projects in the default folder, In my situation it is repos

  • DooksDooks ZAMember ✭✭✭
    edited June 3

    @Korayem said:
    Create file named proguard.cfg inside Android project in the solution. Right click and set Build Action to ProguardConfig.

    Add the following lines:

    -keep class com.google.android.gms.** { *; }
    -dontwarn com.google.android.gms.**
    

    Amend the above according to type of errors you're getting

    Make sure you save file as UTF-8 and NOT UTF-8 BOM

    If you switch on Diagnostic output
    -> Tools
    -> Options
    -> Projects and Solutions
    -> Build and Run
    -> MSBuild ... Output Verbosity
    -> Diagnostic`

    You will find in the output:

    ...
    >C:\Program Files\Java\jdk1.8.0_181\\bin\java.exe -jar ....
    >proguard.ParseException: Unknown option '' in line 1 of file 'myproguard.cfg', (TaskId:261)
    ...
    >Done executing task "Proguard" -- FAILED. (TaskId:261)
    ...
    >Target Performance Summary:
    >       68 ms  XXXXX       1 calls
    >       80 ms  XXXXX       1 calls
    ...
    >Build FAILED.
    ...
    

    This line will indicate whether the file is correct or not:

    >proguard.ParseException: Unknown option '' in line 1 of file 'myproguard.cfg', (TaskId:261)
    

    Create an empty txt file on your pc, then include that in your project, make sure the file is saved as UTF-8

    • Or use Notepad++ to create a UTF-8 Encoded .cfg file then include that into your project
Sign In or Register to comment.