Unity gradle build failed - c#

I can't build another APK in Unity. Always the same error.
CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk1.8.0_171\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'gradleOut'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 27.0.1].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 1s
]
stdout[
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\m-pro\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
Checking the license for package Android SDK Build-Tools 27.0.1 in C:\Users\m-pro\AppData\Local\Android\Sdk\licenses
Warning: License for package Android SDK Build-Tools 27.0.1 not accepted.
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
My settings and things I've tried:
JDK version 1.8
SDK build tool version 25
I tried to copy "-dontwarn com.google.vr.ndk.base.DaydreamApi" into a proguard file (saw this type of a solution somewhere)
Swap from gradle build to internal build (as internal build a different error comes up)
Reinstall all and restart my computer :D

I had this same issue with my Unity builds after the build tools got an update, so you may just have to update them too.
as it says in the error message you need to accept the TOS using android studio
You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 27.0.1].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Install Android studio on your PC (if you havn't already)
run its SDK manager (configure > SDK manager > SDK tools)
If Android SDK build-tools says "Not installed", click the checkbox right next to it to install it.
if It says "Update available" click the checkbox with the "-" next to it so it shows a "✓"
hit apply, and accept the agreement.
That is what fixed it for me, hope this also works for you!

On OSX, I ran into this after upgrading from Unity 2020.3.24f1 to Unity 2020.3.38f1
What fixed it for me was getting the JDK and SDK paths from the Unity/Preferences/external tools, then in a terminal window:
export JAVA_HOME=<the JDK path Unity is using>
<SDK path Unity is using>/tools/bin/sdkmanager --licenses
for me this was:
export JAVA_HOME=/Applications/Unity/Hub/Editor/2020.3.38f1/PlaybackEngines/AndroidPlayer/OpenJDK
/Applications/Unity/Hub/Editor/2020.3.38f1//PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --licenses
This will then prompt to accept several licenses which appear under
/Applications/Unity/Hub/Editor/2020.3.38f1/PlaybackEngines/AndroidPlayer/SDK/licenses
Without the export JAVA_HOME to Unity's version, the sdkmanager --licenses would fail with a Java error.
After I figured this out on my own, I happened to notice the solution in Unity forums as well here: https://forum.unity.com/threads/gradle-build-faled.999773/

Related

Unity no longer able to build project

I've been banging my head against the wall the last 6 days or so trying to get Unity to build my Android game.
My game used to build as it should a few months back, I had a couple new things I came up with and added those (the game runs fine within Unity, there are no errors in play mode).
Trying to build my game with the C++ compiler set to the 'master', however, consistently fails, with the following exceptions:
1.
Building Library\Bee\artifacts\Android\fy9m9\libil2cpp.so failed with output:
C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.gold.exe: internal error in arm_branch_common, at /buildbot/src/android/binutils/toolchain/binutils/binutils-2.27/gold/arm.cc:4063
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
BuildFailedException: Incremental Player build failed!
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <6a5b55f2e18b419e9faedac06ac6af94>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <6a5b55f2e18b419e9faedac06ac6af94>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <b5a1f7b6d39d4ca78ca284153b2ea92d>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <6a5b55f2e18b419e9faedac06ac6af94>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Build completed with a result of 'Failed' in 668 seconds (667590 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <6a5b55f2e18b419e9faedac06ac6af94>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <6a5b55f2e18b419e9faedac06ac6af94>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Things I've tried so far:
Building with the C++ Compiler Configuration set to 'release' also compiles
I can build the project if I switch the platform to Windows
It seems the project can build if I set the compiler to 'debug' instead of 'master', this does not solve the problem, but might be a clue to the actual problem(?)
Making sure it was not caused by something I added: I loaded up the backup of my game (version 1.0, which worked fine and is also published), but the backup can also no longer be build.
Making sure the problem is not with Unity itself, I tried to do a build of a clean project. This works as expected.
I updated all packages in my project
I updated the Unity version my project uses to 2021.3.14f1 (which I also use for another Android project, which can be build with that version).
Updated the Google Play Games for Unity Plugin (https://github.com/playgameservices/play-games-plugin-for-unity) and accompanying code changes that were required
Per response on Reddit, I made sure that no script uses the UnityEditor namespace (the few that do, are put with #IF UNITY_EDITOR commands
Thanks to user jdweng I managed to find the problem by looking at it from a different angle. Which led me to a post on the Unity Forums with someone who has the exact same problem I described: https://forum.unity.com/threads/fails-to-compile-on-android-arm-32.1135633/
One user there mentions a solution (credits to pradotech), which ended up fixing the problem for me:
I could build for Android using Master compiler after changing
Stripping Level to Medium (I was using Low) and switching from .NET
Framework to .NET Standard 2.1. Details below:
Unity 2021.3.9f1
Faster runtime
Compression: LZ4HC API
Compatibility: .NET Standard 2.1
Compiler Configuration: Master
All architectures (ARMv7, ARM64, x86 and x86-64)
Managed Stripping Level: Medium/High
I also removed some unused scripts from project.
Build completed without any errors.
Hope it keeps working and maybe that helps someone.
My project is using Unity 2021.3.14f1, I was already on .Net Standard 2.1.
I changed stripping to Medium, removed a bunch of deprecated scripts and now it works again.

OmniSharp.MSBuild.ProjectManager Attempted to update project that is not loaded:

I started to develop Asp.net Core web API with the VS code. But when I typing the code Intellisense/Suggestions not working properly. I saw in some resource on the internet while they are typing using Microsoft.,
EntityFrameworkCore showing as a suggestion. But In my case, it's not showing. In the OmniSharp log showing following error to me.
Starting OmniSharp server at 4/5/2019, 3:37:16 PM
Target: c:\Dotnet Core\NgWebApi
OmniSharp server started.
Path: C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\OmniSharp.exe
PID: 13684
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\msbuild\15.0\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\msbuild\15.0\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\msbuild\15.0\Bin"
CscToolExe = csc.exe
CscToolPath = C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\msbuild\15.0\Bin\Roslyn
MSBuildExtensionsPath = C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\msbuild
MSBuildToolsPath = C:\Users\Acer\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.11\msbuild\15.0\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Dotnet Core\NgWebApi'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'c:\Dotnet Core\NgWebApi'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Dotnet Core\NgWebApi\NgWebApi.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Dotnet Core\NgWebApi'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Dotnet Core\NgWebApi\NgWebApi.csproj
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Dotnet Core\NgWebApi' on host 17188.
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\Dotnet Core\NgWebApi\NgWebApi.csproj'.
c:\Dotnet Core\NgWebApi\NgWebApi.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. c:\Dotnet Core\NgWebApi\NgWebApi.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, Boolean throwOnFileNotExistsError)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath)
at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath)
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader)
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader)
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: c:\Dotnet Core\NgWebApi\NgWebApi.csproj
I re-installed the VS Code and C# , C# Extention to solve this problem, but it's still occurring. I think the reason was to not showing Intellisense/Suggestions the project is not properly loaded. Can anyone tell me how to avoid this error and how to solve Intellisense/Suggestions not showing the issue.
Solved (cross checked on Ubuntu 16.04 and CentOS 7):
In the VS Code menu, go into File / Preferences / Settings.
In the "Search settings" window, type omnisharp.path
Click on "Edit in settings.json" link.
Add (or edit) like this: "omnisharp.path": "latest"
(from: https://github.com/OmniSharp/omnisharp-vscode/issues/2965)
I solved this issue by doing the following on VSCode:
Go to settings. (Code -> Preferences -> Settings on Mac)
Search "omnisharp".
Find the section "Omnisharp: Use Global Mono," and set it to "always."
Find the section "Omnisharp: Path," and click "Edit in settings.json." Change "omnisharp.path" as "omnisharp.path": latest".
Reload the window.
I found another solution since none of the other solutions were working for me and i was searching for hours.(07/08/2021):
I got the same error with .NET, .NET Core or .NET Framework, here are some screenshots of the errors:
In the error output, it says to install the Developer Pack for this framework version. You can find the version in the .csproj file:
By installing the .NET Framework of this version on the dotnet microsoft site: .NET Framework download list
i fixed the error after reloading VSCode and got my Intellisense working for Unity.
TLDR:
My fix was too install .NET Framework version 4.7.1
To solve this I did several things. First of all, I downgrade OmniSharp version by installing their beta version. download the .vsix file for that release to my machine. Used the following steps to install the .vsix into Visual Studio Code.
Open Visual Studio Code and select View->Extensions from the menu to display the Extensions pane
By clicking the ... at the top-right corner of the Extensions pane and select "Install from VSIX..." on the menu.
Located the .vsix the file I downloaded and Opened it
Then restart vs code
But the problem still occurred, so then I downgraded the .Net core SDK v2.2.202 version to 2.1.202 and the problem is solved.
Updated: Had to face the same issue again after reinstalling VS Code, resolve by.
In the visual studio code menu, go into File > Preferences > Settings. or Press Ctrl+++,
In the Search Setting field, Type omnisharp.path
Click on Edit in settings.json.
in there Add / Edit like this,
{
"omnisharp.path": "latest"
}
If your settings.json already had entries in it, put a comma behind the last one and add the line like this:
{
"workbench.colorTheme": "Solarized Light",
"omnisharp.path": "latest"
}
Finally, save the settings.json
You'll see a prompt: "OmniSharp configuration has changed. Would you like to relaunch the OmniSharp server with your changes?" Click the "Restart OmniSharp" button to reload it.
In the Output window, you can see updates while the latest version downloads
I solved this by upgrading my Mono project version
https://www.mono-project.com/
For the recent version of Omnisharp just uncheck the useModernNet in VS code C# extension setting as shown in the screenshot.
Solved: Check if Visual Studio Build Packages is installed, if so uninstall it. As soon as uninstall VScode will work fine and intellisense feature will be back.
Good luck!
I was also facing the same issue. If none of the above solutions worked then you can try the one below.
While going through the logs, I realized the real problem:
"The SDK 'Microsoft.NET.Sdk' specified could not be found."
I installed latest stable Mono from here (6.8.0):
https://www.mono-project.com/download/stable/
Then opened ~bash_profile and exported framework path of mono:
export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
Works fine for me. Hope it works for you too.
This started happening after the latest Windows10 update.
Re-installed .NET Core Runtime and everything's fine now.
If you are running on an older .NET project (<.NET 6), setting useModernNet to false will allow OmniSharp to target the right .NET framework version.
In settings.json:
"omnisharp.useModernNet": false
Alternatively, this can be done through VS Code's settings pane: File>Preferences>Settings and search for omnisharp.useModernNet and untick the checkbox for Omnisharp: Use Modern Net.
I've had both VSCode and Visual Studio installed on my mac. Uninstalling Visual Studio with this official guide solved the issue.
Another reason this might fail, is when you have Visual Studio 2019 16.7 or below installed, as OmniSharp reqiures MsBuild from 16.8.
Updating Visual Studio using the Visual Studio installer resolved that issue for me, while I was using a replacement machine, that lay dormant for a while now.
If you installed the SDKusing snap / ubuntu software.. that is what caused the same error for me. I answered my own similar question here
Actually the omnisharp path doesn't work for me. I'm on mac. What i did eventually is to download an early version of .net, not the latest 5.
https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-3.0.103-macos-x64-installer
In my case creating C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages folder solved the problem
In my particular case, I was able to solve the Attempted to update project that is not loaded: problem by running dotnet restore across my solution.
It seems I was missing my dependencies.

Unity3D problems building on MacOS

I'm trying to "build" a game project made on Unity3D, but keep getting errors unrelated to the code; as far as I understand.
Unity 3D version 2018.3.0f2
MacBook Pro, MacOS Mojave v. 10.14.2
The game runs fine on this and two other devices which run a Windows 10 OS. It builds without problems on the Windows OS, but not on the MacOS.
The project is the exact same; copied via flash-drive to transfer between the two, and pulled as a git project.
I have tried installing Unity3D via the install assistant, and via Unity Hub; neither made a difference.
I made sure all required dependencies were installed, and re-installed multiple times. Clean installs, restarts, even the OS was re-installed as I had literally just gotten this laptop to work on my Unity game-dev projects.
After many failed attempts, I made a partitioned drive specifically for this project, re installed everything and ran the project for the firs time. Test played it, it ran well, but still wouldn't build. I did that because I thought it was a security or "access rights" problem.
With that, I even allowed Unity access to the whole drive via the security settings of the Mac OS.
[1] https://imgur.com/q4prwXh "Error Screenshot".
What was expected was that the project would build without problems; what happened was that I got these errors which I will try to post a picture of.
The error in text in-case screenshot doesn't work:
[1]
UnauthorizedAccessException: Access to the path "/Volumes/(edited >out)/Temp/StagingArea/Data/Managed/Unity.Analytics.StandardEvents.dll" >is denied.
System.IO.File.Delete (System.String path) (at :0)
UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (System.Collections.IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[] assembliesToStrip, System.String[] searchDirs, System.String monoLinkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:372)
UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:216)
UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:203)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:42)
DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet1[T] filesToNotOverwrite) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:245)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:46)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
[2]
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:96
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Thank you for the help.
If anyone has problems building their Unity3D project on a Mac, I may have found a solution for my problem that could help others.
Two things, one of which may have been the cause of it.
1) I basically ran the Packages Manager within Unity, and removed all packages that were initially added via the Windows version of Unity3D (for Android). I don't know much about this part, but that worked.
2) You need to download and install the latest Xcode from the AppStore, run it with template project (something to make it run and start up); that way it downloads any dependencies or required files. Then, close project, restart the computer, and once back; run your Unity3D project and try building again.
That basically fixed it for me, as there were certain files in the project that needed some "access rights" that were not possible without Xcode being there and installed; which, I think, allows those things to happen.
I hope that helps others.
Best of luck.

Unity Build Error : ('Assets/Plugins/UnityPurchasing/Bin/Stores.dll') : the dll is not allowed to be included or could not be found

I am trying to build an APK (for Android) in Unity 2017, but get a strange build error.
Here are what I have done:
(1) I have already imported Unity IAP, and have verified that the lib Store.dll actually exists inside the folder "Assets/Plugins/UnityPurchasing/Bin/Stores.dll"
(2) I have changed the Build Settings > Player Settings > API Compatibility Level to Net 2.0.
However, I still have this build error:
ArgumentException: The Assembly UnityEngine.Purchasing is referenced by Stores ('Assets/Plugins/UnityPurchasing/Bin/Stores.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:196)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Please let me know how to fix this build error. Thanks.
I have solved this issue.
Basically, I need to ENABLE the IAP purchase option as follow: Go to the Unity menu bar -> Click on Window -> Services -> In App Purchase -> Enable.
After that, the build works fine.
--
PS: I was switching projects a few times and forgot to re-enable the IAP in the new project. That was the reason for this bug to show up.

IntelliSense doesn't work in Visual Studio Code on Mac

I am using Visual Studio Code to develop an ASP.NET 5 application on Mac. The issue I am having is that I don't get any IntelliSense support (e.g. available class methods) beyond simple autocomplete for methods and variables names that I previously typed.
The app targets DNX Core 5.0:
"frameworks": {
"dnxcore50": { }
},
And I have CoreCLR 1.0.0-rc1-update1 installed via DNVM:
$dnvm list
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-rc1-update1 coreclr x64 darwin default
I tried the following to resolve the issue, but with no luck:
Made sure that a project is selected (fire icon in the bottom right corner)
Explicitly turned suggestions in settings.json
{
"editor.quickSuggestions": true`
}
Any suggestions will be much appreciated.
In short, the problem was that, while I had Mono installed on my machine, I didn't have DNX Mono. Installing it via DNVM locally (dnvm upgrade -r mono) resolved the issue and now I am having nice IntelliSense support in Visual Studio Code.
Now the long story.
Visual Studio Code uses OmniSharp to provide IntelliSense support. OmniSharp is a set of tools that provides C# code analysis services through a Nancy-based web API that runs on your machine (great posts on it here and here).
I didn't not get any IntelliSense because OmniSharp ran with errors which I could have easily caught if I paid more attention to Visual Studio Code Output window (Cmd+L L on Mac). OmniSharp Log (see below) shows that it tried to use dnx-mono.1.0.0-rc1-update1 runtime and then threw an exception because it was not there.
From what I understand, OmniSharp can't use DNX CoreCLR (because it doesn't support sockets?) and needs DNX Mono to run. There is some discussion on this topic in VS Code GitHub repo here.
Running dnvm upgrade -r mono and restarting Visual Studio Code fixed the issue. My DNVM set up now looks like this:
Please note that you don't have to use DNX Mono for development in order to get IntelliSense to work. You just need to have it installed.
OmniSharp Log
[INFO] Starting OmniSharp at APP_PATH...
[INFO] Started OmniSharp from '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/jrieken.vscode-omnisharp/bin/omnisharp' with process id 34893...
[INFORMATION:OmniSharp.Startup] Omnisharp server running using stdio at location APP_PATH on host 34884.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning APP_PATH for DNX projects
[INFORMATION:OmniSharp.Dnx.DnxPaths] Using runtime '/Users/nsamteladze/.dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1'.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Found project APP_PATH/project.json.
[INFORMATION:OmniSharp.Dnx.DesignTimeHostManager] Using '/Users/nsamteladze/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1' for design time host.
[ERROR:OmniSharp.Startup] The project system 'DnxProjectSystem' threw an exception.
System.InvalidOperationException: File name has not been set
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0
at System.Diagnostics.Process.Start () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
at OmniSharp.Dnx.DesignTimeHostManager.Start (System.String hostId, System.Action`1 onConnected) [0x00000] in :0
at OmniSharp.Dnx.DnxProjectSystem.Initalize (IConfiguration configuration) [0x00000] in :0
at OmniSharp.Startup.Configure (IApplicationBuilder app, IServiceProvider serviceProvider, ILibraryManager manager, IOmnisharpEnvironment env, ILoggerFactory loggerFactory, ISharedTextWriter writer, IOptions'1 optionsAccessor) [0x00000] in :0
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] No solution files found in APP_PATH
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in APP_PATH.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Solution has finished loading

Categories

Resources