Issue
I am unable to get even an empty Unreal project targeting the Quest 2 platform to build Android targets without errors. It seems to be related to the mess of various Java / SDK / NDK / Gradle versions that aren't compatible with each other, and I can't find a combination that will work. This is what I am currently using according to Android Studio and Android SDK Platform settings in Unreal:
Android SDK:
- API level 28 is installed
- API level 30 is installed
- API level 31 is installed
- SDK Build Tools 31 was installed, but then removed because the build reported a corrupt version
- SDK Build Tools 30.0.3 is installed
- SDK Build Tools 29.0.2 is installed
- Unreal environment is configured for SDK API Level
latest
- Unreal project is configured to target SDK version 28 (Minimum 23)
- I have explicitly provided the location to Unreal Platform Android SDK settings at
D:/android-sdk
which matches the location specified in Android Studio, except Android Studio uses\
and Unreal uses/
.
Android NDK:
- I have 22.1.7171670 installed
- I have explicitly provided the location to Unreal at
D:/android-sdk/ndk/22.1.7171670
- I have told Unreal to use NDK API Level
latest
Java:
- I have JDK 16.0.1 installed at D:\Java
- I have explicitly told Unreal Android SDK settings to use JAVA from
D:/Java
Gradle:
- I updated my UE_4.26\Engine\Build\Android\Java\gradle\gradle\wrapper\gradle-wrapper.properties file to refer to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
and commented out#distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
because of some other error I don't remember right now.
When I try to build a project in this environment (with File > Package Project > Android > Android (Multi: ASTC, DXT, ETC2), the end of my output look like this:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * What went wrong:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Execution failed for task ':app:processDebugManifest'.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5caa5e6c
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Try:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): 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.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Use '--warning-mode all' to show the individual deprecation warnings.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED in 10s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): 16 actionable tasks: 1 executed, 15 up-to-date
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ERROR: cmd.exe failed with args /c "C:\Users\bluem\Documents\Unreal Projects\Quest2Test\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): (see C:\Users\bluem\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Games+Epic+UE_4.26\Log.txt for full exception trace)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED
I changed the SDK target from 28 to 30 and changed the JAVA directory from D:/Java
to C:/Program Files/Java/jdk1.8.0_161
and then the error changes:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * What went wrong:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Execution failed for task ':downloader_library:compileDebugJavaWithJavac'.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Failed to query the value of task ':downloader_library:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, Z:\downloader_library\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFi
leTransformer@2ccc294e) before task ':downloader_library:compileDebugJavaWithJavac' has completed is not supported
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Try:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): 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.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED in 25s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Use '--warning-mode all' to show the individual deprecation warnings.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): 44 actionable tasks: 6 executed, 38 up-to-date
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ERROR: cmd.exe failed with args /c "C:\Users\bluem\Documents\Unreal Projects\Quest2Test\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): (see C:\Users\bluem\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Games+Epic+UE_4.26\Log.txt for full exception trace)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED
If I change either or both of those two settings back to their previous values, the error does not change back to the first error. If I then change the Target SDK version (again) back to 30 then I get the original error again, this time with the Target SDK version set to 30. So it seems like the JDK version is the culprit, but changing the Target SDK version is required to force something to rebuild despite the fact that I have "Full Rebuild" selected in Project Packaging Settings.
Question
So my question is, how do I get past both of these errors?
- Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5caa5e6c
- Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, Z:\downloader_library\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@2ccc294e) before task ':downloader_library:compileDebugJavaWithJavac' has completed is not supported
Solution
Needed to downgrade Gradle back to distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
and that only worked once. I can't build again with the same settings. There appears to be some timing issue that may require waiting for https://github.com/gradle/gradle/issues/16777 to be resolved in order to get past the errors. Every time I build I see a different error. I have seen at least 6 different errors. After deleting the Intermediate and Saved directories I built successfully on the second attempt.
Answered By - BlueMonkMN
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.