Ue4 gradle error

Keywords: UE4, Android

Keywords: UE4, Android

Settings

File Permissions

Project Settings -> Platforms -> Android -> APK Packaging -> Uncheck Use ExternalFilesDir for UE4Game files?

Project Settings -> Platforms -> Android -> Advanced APK Packaging -> Extra permissions -> Add android.permission.WRITE_EXTERNAL_STORAGE

How to enable OpenGL ES3.1 and Vulkan

Project Settings -》 Platforms -》 Android -》 Build -》 Support OpenGL ES3.1, By default is using OpenGL ES2.

How to Hide Android App Soft Keys(Home key and Return key, Virtual Keys)

Project Settings -》 Android -》 Platforms -》 Enable FullScreen Immersive on KitKat and above devices

How to change application name of APK

Project Settings -> Platforms -> Android -> Application Display Name(app_name)

Development

Invoke Java code from C++ in UE4

UE4 – Making a Android Plugin in 10 minutes
https://isaratech.com/ue4-making-a-android-plugin-in-10-minutes/

How to request permissions at run-time

Blueprint:

Request Android Permissions

C++:

UAndroidPermissionFunctionLibrary::AcquirePermissions();

Package Issues

BUILD FAILED:gradlerungradle.bat» :app:assembleDebug

Android APK send to device failed in v4.18, error log:

ExceptionUtils.PrintExceptionInfo: ERROR: cmd.exe failed with args /c "D:Stage - kornelisARcoreHelloARSample 4.18Intermediate/Android/APKgradlerungradle.bat" :app:assembleDebug ExceptionUtils.PrintExceptionInfo: 

Solution 1st (Recommended):
Delete all files, which were the cooked content, under [Project]/intermediate/Android.

Solution 2nd:
1,Double click NVPACK/android-sdk-windows/tools/android.bat;
2,Click “Deselect All”;
3,Check Extras / Android Support Repository, then click Install;

Solution 3rd:
Setup vpn to access google development network to download gradle at first time.

UE4 ERROR: Platform Android is not a valid platform to build

Errors on building:

UE4 ERROR: Platform Android is not a valid platform to build. Check that the SDK is installed properly

Solution 1st:
Kill processs adb.exe.

Solution 2nd:
Delete MyGameBinariesWin64UE4Editor-MyGame.dll and rebuild.

Gradle: Run with –stacktrace option to get the stack trace.

Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.

https://qiita.com/EGJ-Kaz_Okada/items/e325c5e2f8807f430076

Error: Could not get resource

Error Log:

A problem occurred configuring root project 'app'.
 > Could not resolve all files for configuration ':classpath'.
    > Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.1.3-2)
       > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.1.3-2/kotlin-reflect-1.1.3-2.jar'.
          > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.1.3-2/kotlin-reflect-1.1.3-2.jar'.
             > Software caused connection abort: recv failed
> Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.0.0)
   > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
      > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
         > Software caused connection abort: recv failed

Solution:
modify config file UE_4.20EngineBuildAndroidJavagradlebuild.gradle,
add these into build.gradle

jcenter() {
        url "http://jcenter.bintray.com/"
    }

all content:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter() {
            url "http://jcenter.bintray.com/"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    apply from: 'buildscriptAdditions.gradle', to: buildscript
}

apply from: 'baseBuildAdditions.gradle'

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Error: Could not get resource

Error Log:

A problem occurred configuring root project 'app'.
 > Could not resolve all files for configuration ':classpath'.
    > Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.1.3-2)
       > Could not get resource 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.1.3-2/kotlin-reflect-1.1.3-2.jar'.
          > Could not GET 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.1.3-2/kotlin-reflect-1.1.3-2.jar'.
             > Remote host closed connection during handshake
    > Could not download kotlin-stdlib.jar (org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2)
       > Could not get resource 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.jar'.
          > Could not HEAD 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.jar'.
             > Remote host closed connection during handshake
    > Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.0.0)
       > Could not get resource 'http://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
          > Could not GET 'http://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar'.
             > Remote host closed connection during handshake
    > Could not download bcpkix-jdk15on.jar (org.bouncycastle:bcpkix-jdk15on:1.56)
       > Could not get resource 'http://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar'.
          > Could not HEAD 'http://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar'.
             > Remote host closed connection during handshake
    > Could not download bcprov-jdk15on.jar (org.bouncycastle:bcprov-jdk15on:1.56)
       > Could not get resource 'http://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar'.
          > Could not HEAD 'http://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar'.
             > Remote host closed connection during handshake
    > Could not download fastutil.jar (it.unimi.dsi:fastutil:7.2.0)
       > Could not get resource 'http://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
          > Could not HEAD 'http://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
             > Remote host closed connection during handshake
 * Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
 * Get more help at https://help.gradle.org

Solution:
Project Settings -> Platforms -> Android -> Uncheck Enable Gradle instead of Ant

Issue: GetTimeStamp return 0 on Android

Look at Android GetTimeStamp local file handling
https://issues.unrealengine.com/issue/UE-93685

Get rid of all independent versions of Java JDK/JRE. Only use what Android Studio provides.

Android Studio comes with a version of OpenJDK/JRE, sufficient for most Java requirements.

Also, Gradle is an issue, too. Unreal Engine installs this upon launch/packaging your game/app. If you don’t have the «exact» prerequisites, Gradle tries to download what it thinks the SDK and build tools should be, upon compiling and launching your project, and does this regardless of what Android Studio SDK and build tools you have. If you don’t get the prereqs right, it causes a mess of errors. It’s SUPER annoying.

Use the latest Unreal Engine Version 4.27.2.

It’s much more up to date and compatible with VR projects.

As of this writing, there are a LOT newer versions of Android Studio, OpenJDK, Build-Tools and SDKs, NDKs, but Unreal Engine 4.27.2 REQUIRE the outdated versions. This is also partly due to the outdated version of Gradle that the engine itself installs, which is 6.1.1 (not current version 7.3.3), and is installed automatically at compile/launch/package of project, and then tries to install even more outdated prereqs that just don’t work.

Unreal Engine 4.27.2 requires the following, which is NOT in the documentation, NOR is it on the Oculus/Meta Quest documentation. In order to launch VR projects on Quest 2, that works 100% for my setup, and it’s the ONLY thing that has worked for me, do this:

Obviously make sure you have Unreal Engine 4.27.2 installed.

  1. REMOVE ALL VERSIONS OF JAVA’s JDK if present.

  2. Make sure you ONLY use Android Studio 4.0, remove all other versions.

Android Studio 4.0 can be found here: https://developer.android.com/studio/archive

Accept the license agreement and find the version required.

  1. Leave the installation paths for Android Studio AND the SDK as their defaults. («C:Program FilesAndroidAndroid Studio» ; «C:Users[YOUR_NAME]AppDataLocalAndroidSdk»), where [YOUR_NAME] is replaced with your actual user name folder.

  2. Set your environment variables. Both «User»(top window) and «System»(bottom window) for JAVA_HOME as «C:Program FilesAndroidAndroid Studiojre» without the quotes.
    (This is also the path you will use in Unreal Engine for «JDK»)

  3. In Android Studio, SDK Manager, SDK Platforms tab, you MUST have «android-29» (Android 10 Q, API Level 29), but you can install as many SDK versions as you want for other Android devices. (Quest and Quest 2 use Android OS 10 Q.)

  4. After that, click on the SDK Tools tab, and check the box for «Show Package Details».

  5. You MUST have Android SDK build-tools version «29.0.3» AND NO OTHER VERSION!
    (Though Gradle STILL might try to install build-tools 29.0.2 at launch, but at least it won’t affect the launch this time, which is the important thing.)

  6. You MUST have NDK version «r21d», which is «21.4.7075529» in the list.

  7. You need the «latest» Android SDK Command-Line Tools (version 5.0).

  8. You MUST have CMake version «3.10.2.4988404».

  9. You MUST have the Android SDK Platform-Tools.

  10. Add the Android Emulator, and if you have an AMD processor, install the hypervisor driver for it. If you have an Intel processor, install the «Intel X86 Emulator Accelerator».

The «Google Play» stuff, you may or may not need if you are planning on making apps for other devices, but for the Quest/Quest2, it’s not required.

  1. Click on Apply, let everything download and finish, then click finish/close.

  2. REBOOT.

  3. Go to the Unreal Editor’s install location. Under «UE_4.27 > Engine > Extras > Android», execute the SetupAndroid.bat file. It «should» complete successfully. When it does, press any key to close the window.

  4. Open an existing Unreal project or start a new one. (For the sake of this answer, we’re gonna say start a new one using «Games > Virtual Reality», as this has most of the options we need out of the box. Refer to Oculus docs for more information on setting up a new blank project.

IMPORTANT — If you have an existing project:

BEFORE you open it, go into your project folder and DELETE the «Intermediate», «Saved» and «DerivedDataCache» folders.

THEN delete the «.gradle» folder from «C:Users[YOUR_NAME]», replacing [YOUR_NAME] with your actual user name folder.

Optionally, reboot, if you want to, but it’s not necessary.

  1. Once the project is opened, click «Edit > Project Settings». Scroll down to «Platforms > Android SDK». Copy the paths into the appropriate fields:

Location of Android SDK: C:/Users/[YOUR_NAME]/AppData/Local/Android/Sdk

Location of Android NDK: C:/Users/[YOUR_NAME]/AppData/Local/Android/Sdk/ndk/21.4.7075529

Location of JAVA: C:/Program Files/Android/Android Studio/jre

Obviously change [YOUR_NAME] to your user name folder again, and BE MINDFUL of the slash direction, when pasting the paths into the fields: Use the forward slash » / «.

  1. IMPORTANT —

Under SDK API Level, use «android-29» without the quotes.

Under NDK API Level, use «latest» without the quotes.

  1. Scroll up to «Platforms > Android» in the Project Settings, and make sure your «android package name» is set.

Also make sure the «Target API» is set to 29.

Then scroll down to «Build» and make sure «Support arm64» is checked, as the Quest and Quest 2 are 64-bit!

Finally check «Support Vulkan», as Android Vulkan is fully supported and works great on the Q/Q2!

  1. Click «Edit > Plugins». Under «Virtual Reality», make sure EITHER the «Oculus OpenXR» OR «Oculus VR» are checked, NOT BOTH. (I use the Oculus OpenXR plugin for my projects.)

You should be able to follow the rest of the docs on the official pages from here without much issue.

  1. In the view port, under «Settings > Preview Rendering Level», choose «Android Vulkan». This will let you see, more or less, what the game will look like on the Quest/Quest2, while you work on it in the viewport. Let all shaders compile.

  2. Finally, make sure your Quest/Quest2 is set up to launch the game, and go ahead and select it and LAUNCH! It should launch/package successfully.

This has been a 2 day journey for me, and I have been through TONS of solutions that have not worked for me at all. Ultimately, I had to figure this out myself, and so this is my solution. I sincerely hope it helps somebody. It works for me, so I am off to the races with my VR projects!

Epic needs to pick better back ends to use to compile Android apps. Gradle is the number 1 issue preventing MANY people from compiling their apps. My solution plays nice with Gradle, and the Unreal Engine, and OLD STANDALONE JAVA VERSIONS BEGONE!

Finally as a bonus, if you use Godot, you’ll also have no issues as well. Just use the same Android SDK folder path (UNHIDE the «AppData» Folder) for that and you’re all set.

Thank you,

X

Казаков Борис писал(а):

Доброго времени суток многоуважаемые разработчики. Я бы хотел попросить у вас помощи, ибо никто кроме вас, боюсь, мне помочь не может… вообщем при билде игры на андроид выдает очень странную ошибку:
UATHelper: Packaging (Android (DXT)): ERROR: cmd.exe failed with args /c «E:Unril_221ProjectsMobilkaIntermediate/Android/APKgradlerungradle.bat» :app:assembleDebug
до этой была куча других, но их с успехом исправили! вчера/сегодня весь день переустанавливали дрова и прочее, пытались сыскать решение на русских и иностранных форумах, но ничего к моему сожалению не вышло. Поэтому если вдруг вы распологаете информацией как ее исправить, я вас очень прошу сообщеть мне в ЛС, или написать комментрий, даже малейшая информацию может быть полезна!
Спасибо за внимание.

я к сожалению не могу тебе помочь, так как сегодня впервые попробовал собрать проект. Но я хотел бы спросить у тебя, или у сообщества. Мб вы знаете как устранить такую ошибку?

UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ERROR: System.ArgumentException: Staged filesystem reference may not start with a path separator or contain an empty path fragment (trollsContentAssetsbackgroundscandy1sprite33_background.uasset)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в StagedFileSystemReference..ctor(String InName)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в StagedFileReference..ctor(String Name)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в Project.CreateStagingManifest(ProjectParams Params, DeploymentContext SC)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в Project.CopyBuildToStagingDirectory(ProjectParams Params)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в BuildCookRun.DoBuildCookRun(ProjectParams Params)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в BuildCookRun.ExecuteBuild()
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в AutomationTool.BuildCommand.Execute()
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в AutomationTool.Automation.Process(String[] Arguments)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в AutomationTool.Program.MainProc(Object Param)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): в AutomationTool.Program.Main()
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): (see C:UsersDENISAppDataRoamingUnreal EngineAutomationToolLogsD+programmes+UE_4.19UAT_Log.txt for full exception trace)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BUILD FAILED
PackagingResults: Error: Unknown Error

это из-за нижнего подчёркивания или чего то другого? Я не понимаю

проблема решена. Это было из-за 4.19 версии. В 4.19.1 уже всё нормально

$begingroup$

Android Launch error
My sdk settings:

enter image description here

enter image description here

LogPlayLevel: UnrealBuildTool: Preparing native code for debugging...
!LogPlayLevel: UnrealBuildTool: UnrealBuildTool Exception: ERROR: D:/Program Files/NDK/NVPACK/android-ndk-r12b/ndk-build.cmd failed with args APP_ABI="arm64-v8a " NDK_DEBUG=1
LogPlayLevel: CommandUtils.Run: Run: Took 36,7394016s to run UnrealBuildTool.exe, ExitCode=5
LogPlayLevel: BUILD FAILED
PackagingResults:Error: Error Launch failed! Unknown Error

Vaillancourt's user avatar

Vaillancourt

16k17 gold badges53 silver badges61 bronze badges

asked Dec 12, 2016 at 7:53

marvel's user avatar

$endgroup$

1

$begingroup$

I had the same problem when I ‘am trying to deploy my game on my tablet android 5.1 (API 22) so this is what I did :
— Project Settings > Android >
— check Support arm64 [aka arm64-v8a]

enter image description here

just that and then I had the Gradle problem I just unchecked the «Enable Gradle Instead of Ant»

enter image description here

Hope this helps :)

answered Dec 26, 2017 at 9:55

Dhia's user avatar

$endgroup$

$begingroup$

Sometimes it depends on the sequence of the installation. In my case I have to install the NDK first and Unreal later.

The other thing you can do is to check your environment variables if the NDK variables are there or not. If present then clear all location values from SDK config and try to build again that should work.

answered Dec 13, 2016 at 15:10

Himanshu Chaudhary's user avatar

$endgroup$

3

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

Понравилась статья? Поделить с друзьями:
  • Ue33 ошибка пионер 921 ресивер
  • Uap124 ошибка билайн как исправить
  • U8g was not declared in this scope ошибка
  • U44m2p7 код ошибки
  • U3fff ошибка мерседес