Tag Archives: Unity

Error building Player because scripts had compiler errors when packaging ab package

The Error Building Player because scripts had Compiler errors occurred when packing AB packages

Generally occur when the problem mostly using UnityEditor namespace, solution is new and the Editor folder put the script in the space, but for ab to check the packaging can be more than just a namespace, please note that the Editor folder you script the macro definition of whether to use the UNITY_EDITOR or UNITY_EDITOR_WIN two macro definition, if you are using the macro definition is then packaged ab package when also can appear similar problem.
Just try UNITY_STANDALONE_WIN Windows and UNITY_STANDALONE_OSX or just UNITY_STANDALONE_OSX alone if you just want to test it on the Win or Mac platform

[Unity] Solve the problem of IOException: Failed to Copy… in Unity packaging apk

1: error screenshot

2:
First of all, the problem is not packaged when will now, said the reasons for this error is the Temp folder file already exists, leading to conflict with Unity android packaging bag, delete the Temp folder, then repack (Temp file is Unity runtime generated temporary folder, delete will not affect the other project files, the following chart)



conclusion


if this blog has helped you, welcome to click the link below, and more like-minded partners to communicate, together with progress.

Unity Android packaging error “UnityEditor.BuildPlayerWindow+BuildMethodException” solution record

I. Error reporting content:
(Sometimes 49 mistakes, then 19 again. Here’s the last one each time.)

UnityEditor. BuildPlayerWindow + BuildMethodException: 19 errors at UnityEditor. BuildPlayerWindow + DefaultBuildMethods. BuildPlayer (UnityEditor. BuildPlayerOptions options) in x00242 [0]
D:\unity\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
The at UnityEditor. BuildPlayerWindow. CallBuildMethods (System. Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in D:\unity\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

(There is also an error message that differs from other error messages,Gradle is a Unity packaging related tool)

CommandInvokationFailure: Gradle build failed.

 
Two. Solutions
The following four methods are all found by querying the data:
(None of the four approaches successfully solved my problem, but a similar BuildPlayerWindow+BuildMethodException error might occur if you don’t follow these Settings, where the number of errors might be different):

Method 1: File-buildsetting-PlayerSetting-Player-otherSettings-AndroidTVCompatibility disabled (Individual tried not to work)
Method 2: The release path cannot include Chinese, the path cannot be in the project, try to change the path, the release directory is placed in the same level directory as the project (individual tried, but it does not work)
Method 3: File-buildsettings-PlayerSetting-API Compatibility Level Choose Net 2.0(personal try does not work)
Step 4: Remove the plugins folder from the project’s “Assets” folder. I left a plugins/ vscode.cs in my project (I tried it personally but it didn’t work)

Tips for personal success:

Method 5: The name of the file-buildsetting-playersetting-player-productname is the same as the apK name after the file-buildsetting-build (my problem is that I try to change the following to send the package normally)

 
Three. I refer to the UNITY of the android package transmission gate configuration tutorial: https://blog.csdn.net/ChinarCSDN/article/details/79513403
There is also a portal for the error reporting solution of the great God, but I tried that my error reporting was not for this reason, so I failed to solve it.
The software version I used was different, because the time interval was long, so I used JDK-Java SE 8U231 version and SDK-3.5.2 version.
 
 
 

Unity-failed to update unity web player

“failed to update unity web player” error

may occur when using the browser to load the WebPlayer file

this is the error message to connect to the network

solution:

1. Uninstall UnityWebPlayer, use the control panel to uninstall

2. Download the UnityWebPlayer plugin :(this version makes

easier

link: https://pan.baidu.com/s/1f-6mfP8SJjsYe1tm8jSkLQ

extraction code: ht44

if the computer can not network then choose the following UnityWebPlayerFull plug-in

link: https://pan.baidu.com/s/1qHZb0j0LjvoemUreA0LFHQ

extraction code: 75qz


3. Re-enter the game and start the normal game

if you still have problems, try clearing the browser cache and retry

Notes on unity project_ Unity webplayer failed to update unity web player

after unity packages webplayer, four files

will be generated

opens the.html file in the following position

inserts the following code

baseDownloadUrl: "http://wp-china.unity3d.com/download_webplayer-3.x/",  
autoupdateURL : "http://wp-china.unity3d.com/autodownload_webplugin-3.x",  
autoupdateURLSignature : "02a5f78b3066d7d31fb063186a2eec36fdf1205d49c6b0808eb37ef85ed9902e2e1904d87f599238a802ba0abbfe4f18aa82dd2eb5171e99ba839a5cea9e6ea9c1be9eae505937b56fe4a5fd254cffe08958d961f42d970136b5eab9e6c2cd08b81bc8a11e5ade57dc63dcfef2248d89689e4d4feed3cdfe7374c848fd57ebd4" 

is what this code does to let webplayer download
ChinaCache latest version, cause:
Unity works with ChinaCache :CDN acceleration plug-in download

Solution: unity package failed. Commandinvocationfailure: gradle build failed

environment:

unity2018.4.1

jdk1.8.0 _221

is actually a normal procedure and there’s nothing wrong with it.

and then I found that your package today at a wrong CommandInvokationFailure: Gradle build failed. Just this one down here.

I didn’t know how to do it for a while, I thought it was my SDK that was not configured or the JDK version was wrong, but I felt there was no problem. I checked baidu online and found that many people had made this mistake, but they all put forward the problem and there was no good solution.

is generally said to Build System to choose Internal, but this does not seem to work well when it comes to signing certificates, just skipping this issue.

is also a problem with the NDK, the tools aren’t right, gradle isn’t installed, the name of AndroidMainfest, or the JDK version or android SDK. There’s a lot to say.

. signature certificate ?

so go to create a secret key

packaging again, oh huo, success!

so Gradle packaging must be signed!

in case something weird happens, it’s better not to have Chinese paths.

Assertion failed: Assertion failed on expression: ‘pred(* previous, *i)’

Assertion failed: Assertion failed on expression: ‘pred(* previous, *i)’
UnityEngine.Object:Instantiate(GameObject)
IdleLogic:OnLoadCompleted(Object, Object) (at Assets/BLAZGame/Script/GameScript/Idle/IdleLogic.cs:149)
c__Iterator2:MoveNext() (at Assets/BLAZ/Script/Function/AssetBundleManager/BaseLoader.cs:192)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

is an assertion error that doesn’t affect the project, but it looks pretty ugly.

error timing: when the game is running and one of the game resources is loaded, an error is found.

locates this resource

and then click through the resource hierarchy, the assertion error disappears

Speculation

should be an error in the editor Inspector because the editor was previously developed in the project.

The solution of “failed to load il2cpp” in Android package launched by unity

recently upgraded Unity to 2019.3.8f1 with great difficulty, and Android outpackage students have also successfully outpackage online. Results according to operation feedback, some players could not start the game and reported an error of “Failed to load il2cpp“, as shown in figure

, which had never been encountered before.

later after considering this is the upgrade of problem, think either Unity version of the bug, caused by improper or upgrade .

at that time, the latest version of Unity had arrived at 2019.3.14f1. I looked through the release note after 3.8 and found that none of them mentioned this kind of bug. Baidu Google search mentioned about this problem also said in 2019.3.0A has been solved.

, after communicating with the classmate of Android package, I found that the version of NDK is not recommended by Unity. There is a note above, as shown in figure
, which means that the current version of Unity only supports NDK 19.0.5232133. With “Finally found the problem!!” Check the NDK version of his Unity, the result is 19.0.5232133. I could only have left resentfully, but the Android classmate claimed that the NDK version he used for Android Studio was still NDK R14. Yes, that’s it. That’s it.