如何为不同的SDK设置不同的“死代码剥离”选项?

时间:2019-01-24 02:22:07

标签: ios objective-c xcode unity3d libgdx

我正在使用libgdx moe构建ios项目,并希望在其中嵌入一个统一项目。但是libgdx必须启用“死代码剥离”功能,否则将发生错误:

2019-01-23 19:49:17.420737+0800 libgdxUnity[947:975436] *** Terminating app due to uncaught exception 
'java.lang.UnsatisfiedLinkError', reason: 'java.lang.UnsatisfiedLinkError: 
No implementation found for void com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init() 
(tried Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init and Java_com_badlogic_gdx_backends_iosrobovm_IOSGLES20_init__)
    at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init(Native Method)
    at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.<init>(IOSGLES20.java:28)
    at com.badlogic.gdx.backends.iosmoe.IOSGraphics.init(IOSGraphics.java:125)
    at com.badlogic.gdx.backends.iosmoe.IOSGraphics.init(IOSGraphics.java:195)
    at com.badlogic.gdx.backends.iosmoe.IOSApplication.createGraphics(IOSApplication.java:193)
    at com.badlogic.gdx.backends.iosmoe.IOSApplication.init(IOSApplication.java:176)
    at com.badlogic.gdx.backends.iosmoe.IOSApplication.didFinishLaunching(IOSApplication.java:134)
    at com.badlogic.gdx.backends.iosmoe.IOSApplication$Delegate.applicationDidFinishLaunchingWithOptions(IOSApplication.java:75)
    at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
    at com.test.libgdx.unity.IOSMoeLauncher.main(IOSMoeLauncher.java:27)

但是,统一必须禁用“死代码剥离”才能正常编译,否则它将报告错误:

Undefined symbols for architecture arm64:"Geo::GetiOSAppDocumentsDir()", 
referenced from:Geo::PathUtils::GetSandboxDataPath() in libiPhone-lib.a(GeoPathUtils.o)

如何为它们设置不同的“死代码剥离”选项以使其兼容?还是有其他解决方案?

0 个答案:

没有答案