Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

"Failed to recompile android resource files" after adding Unity Ads

Discussion in 'Editor & General Support' started by cristicristi8160, Jun 22, 2016.

  1. cristicristi8160

    cristicristi8160

    Joined:
    May 7, 2016
    Posts:
    17
    Hello!

    I've added Unity Ads using this tutorial



    It showed the ads (testing turned on) in the Game View and basically everything worked well.
    But after building I got this message "Failed to recompile android resource files. See the console for details.".

    So I tried to add Unity Ads using a more professional tutorial made by Unity



    And I get the same error.

    Before these Ads, I could build without any error.

    These are the console messages:

    CommandInvokationFailure: Failed to recompile android resource files. See the Console for details.
    E:\Java\bin\javac.exe -bootclasspath "C:/Users/Cristi/AppData/Local/Android/sdk\platforms\android-23\android.jar" -d "E:\Rolling\Rolling\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\cizmar\tdba\R.java" "com\unity3d\ads\android\R.java"
    stderr[
    Error: Could not find or load main class com.sun.tools.javac.Main
    ]
    stdout[
    ]
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
    UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
    UnityEditor.HostView:OnGUI()

    and

    Error building Player: CommandInvokationFailure: Failed to recompile android resource files. See the Console for details.
    E:\Java\bin\javac.exe -bootclasspath "C:/Users/Cristi/AppData/Local/Android/sdk\platforms\android-23\android.jar" -d "E:\Rolling\Rolling\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\cizmar\tdba\R.java" "com\unity3d\ads\android\R.java"
    stderr[
    Error: Could not find or load main class com.sun.tools.javac.Main
    ]
    stdout[
    ]

    Can somebody help me?
     
  2. cristicristi8160

    cristicristi8160

    Joined:
    May 7, 2016
    Posts:
    17
    Problem was a bad JAVA_HOME path value...
     
  3. Fluzing

    Fluzing

    Joined:
    Apr 5, 2013
    Posts:
    815
    Could you elaborate?