gpt4 book ai didi

java - 无法设置新的 Unreal & Quest 2 开发环境

转载 作者:行者123 更新时间:2023-12-04 23:59:04 33 4
gpt4 key购买 nike

我什至无法获得一个针对 Quest 2 平台的空虚幻项目来构建 Android 目标而不会出现错误。这似乎与相互不兼容的各种 Java/SDK/NDK/Gradle 版本的困惑有关,我找不到可以工作的组合。这是我目前根据 Unreal 中的 Android Studio 和 Android SDK 平台设置使用的:

Android SDK:

  • 已安装 API 级别 28
  • 已安装 API 级别 30
  • 已安装 API 级别 31
  • SDK Build Tools 31 已安装,但随后由于构建报告损坏的版本而被删除
  • 已安装 SDK 构建工具 30.0.3
  • 已安装 SDK 构建工具 29.0.2
  • Unreal 环境配置为 SDK API Level latest
  • Unreal 项目配置为目标 SDK 版本 28(最低 23)
  • 我已经在 D:/android-sdk 明确提供了 Unreal Platform Android SDK 设置的位置,它与 Android Studio 中指定的位置相匹配,除了 Android Studio 使用 \而 Unreal 使用 /

Android NDK:

  • 我安装了 22.1.7171670
  • 我已在 D:/android-sdk/ndk/22.1.7171670 明确向 Unreal 提供位置
  • 我已经告诉 Unreal 使用 NDK API Level latest

Java:

  • 我在 D:\Java 安装了 JDK 16.0.1
  • 我已明确告知 Unreal Android SDK 设置使用 D:/Java 中的 JAVA

Gradle :

  • 我更新了我的 UE_4.26\Engine\Build\Android\Java\gradle\gradle\wrapper\gradle-wrapper.properties 文件以引用 distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip 并注释掉 #distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 因为一些我现在不记得的其他错误。

当我尝试在此环境中构建项目时(使用 File > Package Project > Android > Android (Multi: ASTC, DXT, ETC2)),输出的结尾如下所示:

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

我将 SDK 目标从 28 更改为 30,并将 JAVA 目录从 D:/Java 更改为 C:/Program Files/Java/jdk1.8.0_161 并且然后错误改变:

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

如果我将这两个设置中的一个或两个更改回它们以前的值,错误不会更改回第一个错误。如果我随后(再次)将 Target SDK 版本更改回 30,那么我再次收到原始错误,这次 Target SDK 版本设置为 30。所以看起来 JDK 版本是罪魁祸首,但改变了 Target SDK 版本尽管我在项目打包设置中选择了“完全重建”,但仍需要强制重建某些内容。

问题

所以我的问题是,如何克服这两个错误?

  1. 无法使字段私有(private)最终 java.lang.String java.io.File.path 可访问:模块 java.base 不会“打开 java.io”到未命名的模块 @5caa5e6c
  2. 查询 map(java.io.File 属性(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) 在任务“:downloader_library:compileDebugJavaWithJavac”完成之前不受支持

最佳答案

需要将 Gradle 降级回 distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip那只奏效了一次。我无法使用相同的设置再次构建。似乎有一些时间问题可能需要等待 https://github.com/gradle/gradle/issues/16777要解决以克服错误。每次构建时,我都会看到不同的错误。我已经看到至少 6 个不同的错误。删除 Intermediate 和 Saved 目录后,我第二次尝试构建成功。

关于java - 无法设置新的 Unreal & Quest 2 开发环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68430609/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com