我正在使用LibGDX构建游戏,并且试图将Facebook登录功能添加到iOS项目中。我正在用RoboVM编写平台特定的代码。但是,在使用Gradle构建iOS项目时,从堆栈跟踪中可以看到此错误:

./gradlew launcIPhoneSimulator --stacktrace
Configuration on demand is an incubating feature.
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:ios:compileJava UP-TO-DATE
:ios:processResources UP-TO-DATE
:ios:classes UP-TO-DATE
:ios:jar UP-TO-DATE
:ios:assemble UP-TO-DATE
:ios:compileTestJava UP-TO-DATE
:ios:processTestResources UP-TO-DATE
:ios:testClasses UP-TO-DATE
:ios:test UP-TO-DATE
:ios:check UP-TO-DATE
:ios:build UP-TO-DATE
:ios:launchIPhoneSimulator
ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/620550eae70d9fb66bf2640e93cfa8b9.extracted/META-INF/robovm/ios/libs/FBSDKLoginKit.framework/FBSDKLoginKit(FBSDKLoginButton.o)) was built for newer iOS version (7.0) than being linked (6.0)
ld: warning: object file was built for newer iOS version (7.0) than being linked (6.0)

...

ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKAppEventsState.o)) was built for newer iOS version (7.0) than being linked (6.0)
ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKMaleSilhouetteIcon.o)) was built for newer iOS version (7.0) than being linked (6.0)
ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKTriStateBOOL.o)) was built for newer iOS version (7.0) than being linked (6.0)
ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKMonotonicTime.o)) was built for newer iOS version (7.0) than being linked (6.0)
ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKColor.o)) was built for newer iOS version (7.0) than being linked (6.0)
ld: warning: object file (/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKConstants.o)) was built for newer iOS version (7.0) than being linked (6.0)
Undefined symbols for architecture x86_64:
  "_[j]org.robovm.rt.bro.BufferMarshalers$BufferMarshaler.getBufferAddress(Ljava/nio/Buffer;)J[clinit]", referenced from:
      _[J]org.robovm.apple.foundation.NSData.<init>(Ljava/nio/ByteBuffer;)V in NSData.35d58d41a658287df05cfff49c60793a.class.o
      _[J]org.robovm.apple.foundation.NSData.copy(Ljava/nio/ByteBuffer;II)I in NSData.35d58d41a658287df05cfff49c60793a.class.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
:ios:launchIPhoneSimulator FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ios:launchIPhoneSimulator'.
> Failed to launch simulator

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ios:launchIPhoneSimulator'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.GradleException: Failed to launch simulator
        at org.robovm.gradle.tasks.AbstractSimulatorTask.launch(AbstractSimulatorTask.java:83)
        at org.robovm.gradle.tasks.IPhoneSimulatorTask.invoke(IPhoneSimulatorTask.java:28)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 68 more
Caused by: org.gradle.api.GradleException: Error building RoboVM executable for app
        at org.robovm.gradle.tasks.AbstractRoboVMTask.build(AbstractRoboVMTask.java:108)
        at org.robovm.gradle.tasks.AbstractSimulatorTask.launch(AbstractSimulatorTask.java:35)
        ... 77 more
Caused by: org.apache.commons.exec.ExecuteException: Command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /Users/userXXX/Desktop/Github/projectXXX/ios/build/robovm.tmp/IOSLauncher -arch x86_64 -Wl,-filelist,/Users/userXXX/Desktop/Github/projectXXX/ios/build/robovm.tmp/objects0 -L /Users/userXXX/.m2/repository/org/robovm/robovm-dist/1.12.0/unpacked/robovm-1.12.0/lib/vm/ios/x86_64 -ObjC -exported_symbols_list /Users/userXXX/Desktop/Github/projectXXX/ios/build/robovm.tmp/exported_symbols -Wl,-no_implicit_dylibs -Wl,-dead_strip -F/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/620550eae70d9fb66bf2640e93cfa8b9.extracted/META-INF/robovm/ios/libs -F/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/4f66b056ecec45cba87f52d9408f7689.extracted/META-INF/robovm/ios/libs -F/Users/userXXX/.robovm/cache/ios/x86_64/release/cp/e290d819280b026f5408f7a9216fb05f.extracted/META-INF/robovm/ios/libs -fPIC -mios-simulator-version-min=6.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -lrobovm-bc -force_load /Users/userXXX/.m2/repository/org/robovm/robovm-dist/1.12.0/unpacked/robovm-1.12.0/lib/vm/ios/x86_64/librobovm-rt.a -lrobovm-debug -lrobovm-core -lgc -lpthread -ldl -lm -lz -liconv -lsqlite3 -framework Foundation -framework FBSDKLoginKit -framework AVFoundation -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework StoreKit -framework FBSDKCoreKit -framework Bolts -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -framework AudioToolbox -force_load /Users/userXXX/.robovm/cache/ios/x86_64/release/cp/3aba2d18b9add9eaca2972f68a4520fc.extracted/META-INF/robovm/ios/libs/libgdx.a -force_load /Users/userXXX/.robovm/cache/ios/x86_64/release/cp/3aba2d18b9add9eaca2972f68a4520fc.extracted/META-INF/robovm/ios/libs/libObjectAL.a -force_load /Users/userXXX/.robovm/cache/ios/x86_64/release/cp/39d4c7dae587cb50ba641034bd16d636.extracted/META-INF/robovm/ios/libs/libgdx-box2d.a -lz -framework MobileCoreServices -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks' failed (Exit value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:346)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:149)
        at org.robovm.compiler.util.Executor.exec(Executor.java:344)
        at org.robovm.compiler.util.ToolchainUtil.link(ToolchainUtil.java:405)
        at org.robovm.compiler.target.AbstractTarget.doBuild(AbstractTarget.java:269)
        at org.robovm.compiler.target.ios.AppleDeviceTarget.doBuild(AppleDeviceTarget.java:543)
        at org.robovm.compiler.target.AbstractTarget.build(AbstractTarget.java:263)
        at org.robovm.compiler.Linker.link(Linker.java:423)
        at org.robovm.compiler.AppCompiler.compile(AppCompiler.java:465)
        at org.robovm.compiler.AppCompiler.build(AppCompiler.java:780)
        at org.robovm.gradle.tasks.AbstractRoboVMTask.build(AbstractRoboVMTask.java:104)
        ... 78 more


BUILD FAILED

这也是iOS项目的Gradle脚本:
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"


dependencies {
    compile project(":core")
    compile "org.robovm:robopods-facebook-ios-login:$robopodsVersion"
    compile "org.robovm:robovm-rt:$roboVMVersion"
    compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
    compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
    compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
    compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
}

}

我也将FBSDKLoginKit添加到了robovm.xml文件中,但问题仍然相同。
任何帮助都会很棒。
提前致谢!

最佳答案

好的,我在Mario Zechner的帮助下解决了这个问题。
正如他在这里所说的https://groups.google.com/forum/#!topic/robovm/Ume9XVrGQBg
更新到RoboVM版本1.14.0并删除〜/ .robovm文件夹即可解决此问题!

10-08 18:22