Search Unity

Can't build my Android game PLEASE HELP!!!

Discussion in 'Android' started by KarimSoliman, Jul 23, 2014.

  1. KarimSoliman

    KarimSoliman

    Joined:
    Jul 23, 2014
    Posts:
    2
    Hi guys,

    During building my game this error occurred:

    Error building Player: CommandInvokationFailure: Failed to recompile android resource files. See the Console for details.
    C:\Program Files (x86)\Java\jre7\bin\javac.exe -bootclasspath "C:/Program Files (x86)/Android/android-sdk/platforms/android-20\android.jar" -d "C:\Users\Karim\Documents\New Unity Project 1\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\google\android\gms\R.java" "www\kzlab\com\R.java"

    stderr[

    ]
    stdout[

    This message appears just after "Compiling android resource files." process. This error also occurred after signing my game and adding app advertising AdMob. Before that the game was built several times normally.

    Please help/support in any matter to solve such a problem!! I tried many things without any solutions or results.

    Kindly help!!
     
  2. SHalperin

    SHalperin

    Joined:
    Jul 13, 2013
    Posts:
    12
    What happens if you try to run that command on the command line?
     
  3. KarimSoliman

    KarimSoliman

    Joined:
    Jul 23, 2014
    Posts:
    2
    What do u mean sqh by command line?
     
  4. SHalperin

    SHalperin

    Joined:
    Jul 13, 2013
    Posts:
    12
  5. Reda2

    Reda2

    Joined:
    Jul 25, 2014
    Posts:
    37
    I had the same problem. The solution for me was to locate the "android.jar" file (I did this by searching the file name) I then placed it inside the sdk folder, and that fixed the problem for me.
     
  6. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Hi guys,

    I'm running into the exact same issue. What exactly was the fix?

    Reda2: Where in the sdk folder did you put the android.jar file?
     
  7. madfad

    madfad

    Joined:
    Jul 26, 2014
    Posts:
    4
    Hi,

    I'm also running into this issue. Does anyone know the solution? (I'm not sure what Reda2 meant by placing it inside the SDK folder).
     
  8. Ramonaann

    Ramonaann

    Joined:
    Mar 2, 2015
    Posts:
    3
    also have the problem,need help
     
  9. madfad

    madfad

    Joined:
    Jul 26, 2014
    Posts:
    4
  10. GameSpire

    GameSpire

    Joined:
    Jan 31, 2016
    Posts:
    10
    I had same problem and i managed to solve it:

    i uninstalled all Java version and re download again, but not need to download JRE, download JDK instead. Overwise you will have problem or missing javac.exe file (or incorrect version if you download it elsewhere).
    Also it is required to add system variables JAVA_HOME to "c:\Program Files\Java\jdk1.8.0_91" (your path) and PATH variable to "c:\Program Files\Java\jdk1.8.0_91\bin" and restart computer. Hope it helps for you also!