Search Unity

ToolNotFoundException: jar not found.

Discussion in 'External Tools' started by martin_unity660, Mar 4, 2019.

  1. martin_unity660

    martin_unity660

    Joined:
    Feb 15, 2019
    Posts:
    21
    Hi,

    I'm unable to switch my Platform to Android. My console get spammed with "ToolNotFoundException: jar not found."

    • "Edit->Preferences->External Tools->Use embedded JDK" is checked
    • My JAVA_HOME environment variable is set to the Unity embedded JDK "C:\Program Files\Unity\Hub\Editor\2018.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\OpenJDK\Windows"
    • PATH environment variable includes %JAVA_HOME%\bin
    • I'm able to run "jar" from command prompt.
    I'm now out of ideas.


    Code (CSharp):
    1. ToolNotFoundException: jar not found.
    2. GooglePlayServices.ResolverVer1_1.ShouldExplode (System.String aarPath) (at Z:/tmp/tmp.mz1RZCSjez/third_party/unity/unity_jar_resolver/source/PlayServicesResolver/src/ResolverVer1_1.cs:1513)
    3. GooglePlayServices.ResolverVer1_1.LoadAarExplodeCache () (at Z:/tmp/tmp.mz1RZCSjez/third_party/unity/unity_jar_resolver/source/PlayServicesResolver/src/ResolverVer1_1.cs:256)
    4. GooglePlayServices.ResolverVer1_1..ctor () (at Z:/tmp/tmp.mz1RZCSjez/third_party/unity/unity_jar_resolver/source/PlayServicesResolver/src/ResolverVer1_1.cs:220)
    5. GooglePlayServices.PlayServicesResolver..cctor () (at Z:/tmp/tmp.mz1RZCSjez/third_party/unity/unity_jar_resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:624)
    6. Rethrow as TypeInitializationException: The type initializer for 'GooglePlayServices.PlayServicesResolver' threw an exception.
    7. Firebase.Editor.XcodeProjectPatcher..cctor () (at Z:/tmp/tmp.sXL81rhJWV/firebase/app/client/unity/editor/src/XcodeProjectPatcher.cs:61)
    8. Rethrow as TypeInitializationException: The type initializer for 'Firebase.Editor.GenerateXmlFromGoogleServicesJson' threw an exception.
    9. System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    12. System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    13. System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    14. System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    15. System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    16. System.Activator.CreateInstance (System.Type type) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    17. UnityEditor.AssetPostprocessingInternal.GetTextureProcessorsHashString () (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:490)
    18. UnityEditor.AssetPostprocessingInternal:GetTextureProcessorsHashString()
     
    Last edited: Mar 4, 2019
  2. martin_unity660

    martin_unity660

    Joined:
    Feb 15, 2019
    Posts:
    21
    Restarting the computer has fixed the issue. Very weird.
     
    Mhietos likes this.
  3. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    32
    it doesn't helps for me
     
    VonTala likes this.
  4. PauloBissonho

    PauloBissonho

    Joined:
    Dec 1, 2018
    Posts:
    4
    I have the same problem
    Did you get it right?
     
  5. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    32
    It strange but I just have rebooted and these errors just disappeared
     
  6. jacknoid

    jacknoid

    Joined:
    Nov 28, 2018
    Posts:
    15
    Bumping this, on 2019.1.(5f or 7f). I installed the android packages through Hub, and have all the boxes checked in Preferences->External Tools for java and android. My builds fail with the same Jar Not Found errors.
     
  7. scorp2007

    scorp2007

    Joined:
    Aug 17, 2014
    Posts:
    26
    same... help plz
     
  8. jacknoid

    jacknoid

    Joined:
    Nov 28, 2018
    Posts:
    15
    More info: If i click "Build" and simply save the apk locally i get the same errors in the console but the build completes and writes the APK to disk. If I have my testing phone plugged in (same phone that worked before i reinstalled my operating system) and i try 'Build and run' the build process fails almost immediately with the same errors in the console.
     
  9. jacknoid

    jacknoid

    Joined:
    Nov 28, 2018
    Posts:
    15
    Fixed! I had to set the ANDROID_HOME environment variable to the SDK path, in my advanced systems settings on windows. I just pointed it at the unity managed copy of the SDK, which for me was
    C:\Program Files\Unity\Hub\Editor\2019.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK


    I also logged out and back in again to make sure the environment variable was picked up by already running programs.

    Here's a guide: http://www.software-testing-tutoria.../09/set-androidhome-and-path-environment.html
     
  10. unity_KNMBKAJDXv98xw

    unity_KNMBKAJDXv98xw

    Joined:
    Aug 1, 2018
    Posts:
    4