Tag Archives: UE4

[Solved] UE4 Android Package Error: cmd.exe failed with args

Edition:

UE4.27.2, Android Studio 4.0, Window system

Error content:

ERROR: cmd. exe failed with args /…….

Execution failed for task ‘:app:compileDebugJavaWithJavac’

> Compilation failed; see the compiler error output for details.

Solution:

This type of error reporting is general, JAVA-related error reporting, the red letter will only give cmd.exe failed with args, only search the line of error is unable to find the problem.

Error log to turn up, find * What went wrong:, the next two lines of the line is the real content of the error report.

In my personal case, the specific error is

Execution failed for task ‘:app:compileDebugJavaWithJavac’.

> Compilation failed; see the compiler error output for details.

The problem is caused by the inconsistency between the JDK version selected by UE4 and the JDK version in the system environment variable, either modify the JDK version selected by UE4 or modify the system environment variable.

The former: Edit->Project Settings->Android SDK->Location of JAVA, select the same JDK directory as your environment variable, and go to Edit->Project Settings->Android, you need to click Configure Now again.

The latter: open the system environment variables, find JAVA_HOME in the system variables, edit and modify it to the JDK version selected by UE4; find Path, double click to open it, find C:\Program Files (x86)\Common Files\Oracle\Java\javapath this line, copy the address, open it in the folder and delete the 3 JAVA files in it. Finally, open CMD and type java -version to test if the replacement has been completed.

How to Solve UE4 packaging Android error

UE4 packaging Android error reporting solution

Error:

insert picture description here

The error is as above

Workaround:

1. Find the UE installation directory UE_4.26\Engine\Extras\Android such as :

E:\UE4\UE4An\UE_4.26\Engine\Extras\Android

2. Start the SetupAndroid.bat file in this directory

insert picture description here

3. The file starts to download sdk, According to the download prompt, you can know the sdk download directory.

insert picture description here

4. Open UE, in the project settings ProjectSettings to Android SDK to configure the SDK corresponding to the download in the previous step, in which, NDK is also in the download directory, jdk can use 1.8.0

insert picture description here

5. Package successfully

insert picture description here

How to Solve UE Shader develop error

As far as I can observe, the UE is generally loaded to 39%-45% when the compilation of the Shader will be carried out, but due to our sometimes negligent, often write shader with errors, resulting in the UE directly crash without prompting error messages, given that only the ConsoleVariables.ini file needs to be configured.

original:

[Startup]
; Uncomment to get detailed logs on shader compiles and the opportunity to retry on errors
;r.ShaderDevelopmentMode=1
; Uncomment to dump shaders in the Saved folder
; Warning: leaving this on for a while will fill your hard drive with many small files and ...

After modification:

[Startup]
; Uncomment to get detailed logs on shader compiles and the opportunity to retry on errors
r.ShaderDevelopmentMode=1
; Uncomment to dump shaders in the Saved folder
; Warning: leaving this on for a while will fill your hard drive with many small files and ...

Can’t you see the change? Pay attention

r.ShaderDevelopmentMode=1

Removed the “;” in front, This is the difference. In this way, when we write the shader, it will directly tell us what errors are, which will greatly help us eliminate errors, such as undefined variables (written incorrectly due to negligence).

[Solved] UE4UE5 Package Android Error: UnrealBuildTool failed

Error:

Android\armv7\gradle\rungradle.bat……UnrealBuildTool failed

Solution:

1. Replace gradle package

Download address: http://services.gradle.org/distributions/

Replace with: C:\Users\your_user_name\.gradle\wrapper\dists\gradle-x.x-all\xxxxxxxxxxxxxxxxxxxxxxx

2. Update SDK
check the latest SDK in SDK manager in Android studio (you can download the update directly)

3. Update NDK and build tool

Error reported: XXXXXX\gradle\rungradle.bat” :app :assembleDebug

Solution: in the SDK manager, find SDK Tools – Show package details and delete the build tool version with relevant errors according to the error information.

Just pack it.

[Solved] C++ Compile Error: prerequisites are different [How to Solve]

Scene

When adding new x.h/x.hpp/X.C/x.cpp files to the UE4 project, even if there are no other files to include these new files, the following errors may appear during compilation (both build and rebuild):
unrealbuildtool prerequisites are different
this error occurs when the x.obj file is compiled, but the link operation cannot be performed correctly

reason

As the name suggests, there is no problem with the code itself, but that the code block cannot be integrated into the existing project. UE4 has preprocessing on the path for the include file. If the path name of the file is duplicate, this problem will occur. For example:

1. Proto/error.pb.h already exists under module 

2. try to add Server/XXServer/proto/error.pb.h

According to the include rule of UE4, #include "proto/error.Pb.H" may point to two files at the same time (when the files in the server/xxserver directory are imported), so it cannot be judged accurately, and an error is reported during compilation.

Note: unrealbuildtool under Windows does not judge case, and the paths of proto/and proto/are the same

Solution:

    directory paths should not overlap. Try to avoid the path with the same name.
    1. There should be no files with the same name under the path

 

[Solved] UE4 Android Package Error: failed for task :permission_library:compileDebugJavaWithJavac

Record ue4.27 Android packaging failure compileDebugJavaWithJavac

Enter the project folder G: \UE4_Project\MyProject\Intermediate\Android\arm64\gradle

Execute CMD  gradlew compileDebugJavaWithJavac

Solutions:

1. Add the red part to the .Build.cs of the project

2. Create extra file_UPL_.xml

3. Paste the following content into XML

<?xml version="1.0" encoding="utf-8"?>
<!-- XML -->
<root xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Gradle Properties -->
<gradleProperties>
<insert>
ANDROID_BUILD_TOOLS_GRADLE_VERSION=com.android.tools.build:gradle:3.5.3
</insert>
</gradleProperties>
</root>

Error C1083 error msb3075 in UE4 generated by vs2019 debug editor

Problem Description:
psallocator. H (40): fatal error C1083: TypeInfo. H: no such file or directory
error msb3075 shadercompileworker win64 development “- waitmutex – frommsbuild” has exited with code 5. Verify that you have sufficient permissions to run this command

Solutions:
1. Run as an administrator (possibly redundant steps)
2. Delete the code # include & lt; TypeInfo. H & gt;

How to set the custom blood bar UI in UE4 and how to call it

to set up a custom UI plug-in:

1. Select Widget Blueprint

2. Drag into a Horizontal Box, ProgressBar

3. Set control Size to Fill

4. Adjust the fill color and opacity of the control

3. Call

returns to the main UI design scenario, dragging the custom control, the health control, to the desired visit location.

as shown in the figure below:

The

effect is as follows: