2

I have been stuck at this for quite some time now, I solved it previously by deleting the plugins folder, but that broke the ads in the game, I want a good solution for this, I couldn't find any in the forums or elsewhere.


it's an android application and using SDK 9 API level 28, downloaded from android studio. NDK r16b . build system Gradle. and building as Build app bundle (aab) same thing however as apk.


error message:

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:191 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


error pop up

see image

Fawaz Aljohani
  • 95
  • 1
  • 1
  • 6
  • Problem is that these two errors only are the final exception that the build went wrong; they do not explain **why** which should be stated somewhere further up in the console. Did you try to delete the `Temp` folder? In general sometimes it helps to "reset" your project and let Unity re-build all libraries again. In [Cleaning up and Migrating existing Unity project into new one or another PC](https://stackoverflow.com/a/56267992/7111561) I explained how this can be done with `git` – derHugo Nov 28 '19 at 06:44
  • Also maybe try the Unity built-in SDK and NDK – derHugo Nov 28 '19 at 06:45
  • The temp folder is indeed deleted, so i don't think it can help. i think that the issue is with the sdk and ndk or something but i can't figure it out, I would use Unity's built-in SDK and ndk but in the version, im using 2018.4 and the option to include SDK and NDK does not show in the unity hub. im certainly sure that the issue has to do with unity ads, without them, everything runs just fine – Fawaz Aljohani Nov 29 '19 at 07:25
  • Which Unity version are you using? Make sure to always install Unity via the Hub! If you installed it directly via download and then added it to the Hub manually it is not "linked" to the Hub and you don't have the option to add features afterwards – derHugo Nov 29 '19 at 07:29

2 Answers2

0
  • Create a Universal Windows Project and check that you can run a project correctly

  • Update Windows to version 1903

  • load visual studio and run a Universal Windows Project. Check that it works, by running the project.

  • Create a new Unity project. Navigate to your project and select build to create a .sln file. Note: not Build and Release.

  • Make sure AppX includes a copy of the files from the subdirectory inside your project folder.

  • Copy 3 dll's and paste them into your AppX directory where the exe for you project is located. They are: vccorlib140_app.dll, VCRUNTIME140_APP.dll and MSVCP140_APP.dll.

  • Test your exe inside the APPX folder to check that there are no complaints about the dll's.

  • Go back into Unity select UWP and then select build and run.

sjc
  • 1,117
  • 3
  • 19
  • 28
James Phelps
  • 45
  • 1
  • 2
0

Resolved by

  • Making sure that SDK, NDK, GRADLE, etc, had the right file folder.
  • Plus get version 19.xx of NDK.
  • Rename the folder to the one Unity wants.
  • Edit the SOURCE file to refer exactly to the name Unity wanted.
scott_lotus
  • 3,171
  • 22
  • 51
  • 69