Android Build Error - Value cannot be null.
Hello everyone, I'm trying to get the Android version of my game running and I'm not having any luck. Here is the error I'm seeing when I try to build:
ArgumentNullException: Value cannot be null.
Parameter name: path1
System.IO.Path.Combine (System.String path1, System.String path2) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
UnityEditor.Android.AndroidComponentProperties.Read (System.String directory) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.AndroidComponentProperties.GetPackageRevision (System.String directory) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.AndroidSDKTools.BuildToolsVersion () (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKBuildToolsDetector.GetVersion (UnityEditor.Android.AndroidSDKTools sdkTools, UnityEditor.Android.AndroidJavaTools javaTools) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (UnityEditor.Android.AndroidSDKTools sdkTools, UnityEditor.Android.AndroidJavaTools javaTools, System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (UnityEditor.Android.AndroidJavaTools javaTools, System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <177bc8179be6497489c4b5b319f290d7>:0)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:106)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Here is what I have tried: Restart Unity, Reinstall Unity, Update Android SDK/Android Studio, Update JDK, Change Target API
Here is my environment: Unity - 2019.1.2f1, JDK - 1.8.0_212, Android Studio with latest SDK updates.
After searching around for this error, it appears I'm not the only one with this issue and there hasn't been a solid resolution posted. Does anyone have any ideas? I would appreciate any help you could offer!
Answer by Daemon0x0 · Apr 01, 2020 at 10:00 PM
@chadq Just try to go to Edit -> Preference -> External Tools and check Gradle installed with Unity. It started to work like a charm for me. I was trying to uninstall and install Unity, check Autographics API, reimport all assets but nothing to work. Only check Gradle installed with Unity helped me.
Answer by mayankela21 · Aug 31, 2019 at 09:49 AM
Go to Android PlayerSettings Enable Auto Graphics API
Wow Thanks I Gotta Try And See If It Works, THAN$$anonymous$$S!
Answer by protogamefly · May 13, 2019 at 01:13 PM
Hi,
I have same error, but after install manually the JDK : https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html It's work fine.
Thank you, protogamefly. Unfortunately, I have tried both manually installing JD$$anonymous$$ 8 and JD$$anonymous$$ 12 and setting up the appropriate External links to them, but neither have fixed this issue.
Your answer
Follow this Question
Related Questions
Quick question: How do I change to 64 bit? 1 Answer
Android Touch Input not working in Build 3 Answers
Building game for android - ERROR! 1 Answer
Android Build Crashes on Tablet 0 Answers
Failed to re-package resources 0 Answers