Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity Admob Error

Discussion in 'Unity Ads' started by Andre Correia, Oct 21, 2014.

  1. Andre Correia

    Andre Correia

    Joined:
    Feb 28, 2013
    Posts:
    5
    Hello everyone!

    I'm currently making an android app and already posted it one gogle play, and i was hopping to put some adds on it, i'm trying to use Admob with unity and i am going crazy with the error below.

    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:/Users/Andre/Desktop/adt-bundle-windows-x86_64-20140702/sdk/platforms/android-21\android.jar" -d "C:\Users\Andre\Desktop\ADDS\googleads-mobile-plugins-master\unity\samples\HelloWorld\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\example\admobtest\R.java" "com\google\android\gms\R.java"

    Don't know what else to do, i have a 64 bit machine, have the sdk fully installed, jdk installed,and going crazy for like 4 or 5 days...
    if anyone can help, thanks a lot!!
     
  2. unity-nikkolai

    unity-nikkolai

    Unity Technologies

    Joined:
    Sep 18, 2014
    Posts:
    541
    Last edited: Oct 21, 2014
  3. Andre Correia

    Andre Correia

    Joined:
    Feb 28, 2013
    Posts:
    5
    I did this below.. can u tell if i'am doing anything wrong please.

    Cumps.


    Sem Título.png
     
  4. unity-nikkolai

    unity-nikkolai

    Unity Technologies

    Joined:
    Sep 18, 2014
    Posts:
    541
    You created a new system variable called JAVA_HOME. You still need to add it to the PATH system variable. Do so by adding %JAVA_HOME%; to the beginning of the path.

    Also, to see changes to environment variables take effect, you need to log out of your current Windows session (or the current terminal session, for anyone making path changes via terminal) and log back in.

    You can test these changes by opening a console window and typing echo %PATH%. You should see a reference to your JDK among the semicolon delineated string of paths.
     
    Last edited: Oct 21, 2014
  5. unity-nikkolai

    unity-nikkolai

    Unity Technologies

    Joined:
    Sep 18, 2014
    Posts:
    541
    Sorry, I misunderstood the situation. Looks like you added javac.exe to the existing path for the runtime engine. Don't modify the System environment variable JAVA_HOME. That is placed there by the Java Runtime Engine when it's installed.

    Instead, create a new User environment variable (not System environment variable) called PATH if it doesn't already exist, and provide the path to the bin directory (not the javac.exe) found in your Java Development Kit install directory.
     
    Last edited: Oct 21, 2014