Unityで制作したゲームをAndroid用にビルドしようとしています。
Android StudioでAndroid 9.0と10.0をインストール済みですが、Project SettingsでAPI Levelが選べなくなっています。
JDK・SDK・NDKもインストールして、パスも正しいはずなのですが。
また、Unityのプログラムでエラーが表示されており、現在2つあります。
NullReferenceException: Object reference not set to an instance of an object UnityEditor.Android.SDKManager..ctor () (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.SDKManager.GetInstance () (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.AndroidPreferenceWindowExtension.WritePreferences () (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.PreferencesProvider.WritePreferences () (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:829) UnityEditor.PreferencesProvider.ApplyChangesToPrefs (System.Boolean force) (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:539) UnityEditor.PreferencesProvider.ShowExternalApplications (System.String searchContext) (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:382) UnityEditor.PreferencesProvider.OnGUI (System.String searchContext, System.Action`1[T] drawAction) (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:308) UnityEditor.PreferencesProvider+<CreateExternalToolsProvider>c__AnonStorey1.<>m__0 (System.String searchContext) (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:211) UnityEditor.SettingsProvider.OnGUI (System.String searchContext) (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsProvider.cs:103) UnityEditor.SettingsWindow.DrawControls () (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:322) UnityEditor.SettingsWindow.DrawSettingsPanel () (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:313) UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298) UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483) UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466) UnityEngine.UIElements.KeyboardEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/KeyboardEventDispatchingStrategy.cs:21) UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280) UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156) UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:190) UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255) UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78) UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Threading.ThreadHelper.ThreadStart () (at <567df3e0919241ba98db88bec4c6696f>:0) UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs) (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)
自分でも修正方法を調べ、インストールしたbuild-toolsに、29.0.3と30.0.0-rc4があったのを、29.0.3を消してみましたが、変わりませんでした。
PC:Windows10
Unity:Unity 2019.2.15f1 (64-bit)
Android Studio:Version 4.0
追記(6/4 23:30)
再度プロジェクトを開いたら表示されたエラー
CommandInvokationFailure: Failed to update Android SDK package list. C:/Android\tools\bin\sdkmanager.bat --list stderr[ ] stdout[ ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.SDKManager.UpdatePackagesList () (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.SDKManager.ListAvailable (UnityEditor.Android.SDKManager+Component type) (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.PlayerSettingsEditorExtension.<StartGettingReleasedAPILevels>m__0 () (at <21da158cd428404389e0b5a08ba9ea0a>:0) System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Threading.ThreadHelper.ThreadStart () (at <567df3e0919241ba98db88bec4c6696f>:0) UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs) (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)
Unity Hub:Unity Hub 2.3.2
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。