我试图更新旧的 LibGDX 游戏以使用各种第 3 方库的最新版本,但无法让它在设备上运行。我想我应该回到基础知识并创建一个新的 LibGDX 项目来检查其是否有效,但我仍然遇到相同的错误。这是一个未受影响的项目,只是将 Sign Identity 和 Provisioning Profile 添加到了 build.grade 文件中。
新的 iOS 项目对其他人有用吗?这个错误的原因是什么?
17:55:34: Executing 'launchIOSDevice'...
Starting Gradle Daemon...
Gradle Daemon started in 569 ms
> Task :core:compileJava UP-TO-DATE
> Task :ios:compileJava UP-TO-DATE
> Task :ios:processResources NO-SOURCE
> Task :ios:classes UP-TO-DATE
> Task :ios:jar UP-TO-DATE
> Task :ios:assemble UP-TO-DATE
> Task :core:processResources NO-SOURCE
> Task :core:classes UP-TO-DATE
> Task :core:jar UP-TO-DATE
> Task :ios:compileTestJava NO-SOURCE
> Task :ios:processTestResources NO-SOURCE
> Task :ios:testClasses UP-TO-DATE
> Task :ios:test NO-SOURCE
> Task :ios:check UP-TO-DATE
> Task :ios:build UP-TO-DATE
> Task :ios:launchIOSDevice
ld: warning: ignoring duplicate libraries: '-lz'
0 0x1025db648 __assert_rtn + 72
1 0x1025960f0 ___Z13dispatchApplyIRKmZ15dispatchForEachIKN6mach_o13CompactUnwind11Diff24FixupEZNK2ld16LayoutExecutable18writeCompactUnwindENSt3__14spanIhLm18446744073709551615EEEyRKNS7_13SectionLayoutEE4$_26EvNSA_IT_Lm18446744073709551615EEEmT0_EUlmE_EvOSG_SI__block_invoke + 0
2 0x18c5f5950 _dispatch_client_callout2 + 20
3 0x18c60a1a4 _dispatch_apply_invoke_and_wait + 176
4 0x18c609464 _dispatch_apply_with_attr_f + 1176
5 0x18c609650 dispatch_apply + 96
6 0x102596398 ld::LayoutExecutable::writeContentWithoutLinkEdit(std::__1::span<unsigned char, 18446744073709551615ul>, unsigned long long) + 672
7 0x10259c020 ld::LayoutExecutable::writeToFile(char const*) + 15248
8 0x10254e2e8 main + 9424
ld: Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
> Task :ios:launchIOSDevice FAILED
5 actionable tasks: 1 executed, 4 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ios:launchIOSDevice'.
> Failed to launch IOS Device
Error building RoboVM executable for app
Command '[/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++, -o, /Users/williamcalderwood/Downloads/test/ios/build/robovm.tmp/IOSLauncher, -Wl,-filelist,/Users/williamcalderwood/Downloads/test/ios/build/robovm.tmp/objects0, -L, /Users/williamcalderwood/.m2/repository/com/mobidevelop/robovm/robovm-dist/2.3.20/unpacked/robovm-2.3.20/lib/vm/ios/arm64, -ObjC, -exported_symbols_list, /Users/williamcalderwood/Downloads/test/ios/build/robovm.tmp/exported_symbols, -Wl,-no_implicit_dylibs, -Wl,-dead_strip, -F/Users/williamcalderwood/.robovm/cache/ios/arm64/release/Users/williamcalderwood/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-platform/1.12.0/e7eb1777f7c465f6ef8cb1dad7dfc405184f17aa/gdx-platform-1.12.0-natives-ios.jar.extracted/META-INF/robovm/ios/libs, -F/Users/williamcalderwood/.robovm/cache/ios/arm64/release/Users/williamcalderwood/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-platform/1.12.0/e7eb1777f7c465f6ef8cb1dad7dfc405184f17aa/gdx-platform-1.12.0-natives-ios.jar.extracted/META-INF/robovm/ios/libs/gdx.xcframework/ios-arm64, -F/Users/williamcalderwood/.robovm/cache/ios/arm64/release/Users/williamcalderwood/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-platform/1.12.0/e7eb1777f7c465f6ef8cb1dad7dfc405184f17aa/gdx-platform-1.12.0-natives-ios.jar.extracted/META-INF/robovm/ios/libs/ObjectAL.xcframework/ios-arm64, -L/usr/lib/swift, -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos, -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/iphoneos, -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos, -fPIC, --target=arm64-apple-ios11.0, -isysroot, /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk, -lrobovm-bc, -force_load, /Users/williamcalderwood/.m2/repository/com/mobidevelop/robovm/robovm-dist/2.3.20/unpacked/robovm-2.3.20/lib/vm/ios/arm64/librobovm-rt.a, -lrobovm-debug, -lrobovm-core, -lgc, -lpthread, -ldl, -lm, -lz, -liconv, -lsqlite3, -framework, Foundation, -framework, OpenGLES, -framework, gdx, -framework, ObjectAL, -framework, UIKit, -framework, QuartzCore, -framework, CoreGraphics, -framework, OpenAL, -framework, AudioToolbox, -framework, AVFoundation, -framework, GameController, -lz, -framework, MobileCoreServices, -Xlinker, -rpath, -Xlinker, /usr/lib/swift, -Xlinker, -rpath, -Xlinker, @executable_path/Frameworks, -Xlinker, -rpath, -Xlinker, @loader_path/Frameworks]' failed (Exit value: 1)
* Try:
> 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 58s
17:56:33: Execution finished 'launchIOSDevice'.
我在 Discord 服务器上得到了 Berstanio 的帮助。
您需要降级到 XCode 14 或附加 -ld_classic 链接器标志(https://github.com/MobiVM/robovm/pull/714关于如何做 它)