在RoboVM中使用<treeshaker> agressive后,Box2D中的NoSuchMethodError

时间:2015-06-24 23:07:06

标签: libgdx robovm

应用程序在启动时崩溃。这是堆栈跟踪。该应用程序可以正常设置为&#34;保守&#34;但我绝对希望它占用更少的空间。

版本: gdxVersion =&#39; 1.6.1&#39; roboVMVersion =&#39; 1.4.0&#39;

这是项目中的依赖项(&#34;:ios&#34;)

compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"

这是项目中的依赖项(&#34;:core&#34;)

compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"

例外:

java.lang.NoSuchMethodError: beginContact
    at com.badlogic.gdx.physics.box2d.World.newWorld(Native Method)
    at com.badlogic.gdx.physics.box2d.World.<init>(World.java)
    at com.cereal.stackking.worlds.GameWorld.<init>(GameWorld.java)
    at com.cereal.stackking.worlds.ArcadeWorld.<init>(ArcadeWorld.java)
    at com.cereal.stackking.screens.ArcadeScreen.startNewWorld(ArcadeScreen.java)
    at com.cereal.stackking.screens.ArcadeScreen.<init>(ArcadeScreen.java)
    at com.cereal.stackking.screens.MainMenuScreen.populateTable(MainMenuScreen.java)
    at com.cereal.stackking.screens.MainMenuScreen.<init>(MainMenuScreen.java)
    at com.cereal.stackking.Staq.load(Staq.java)
    at com.cereal.stackking.screens.SplashScreen.render(SplashScreen.java)
    at com.badlogic.gdx.Game.render(Game.java)
    at com.cereal.stackking.Staq.render(Staq.java)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics.draw(IOSGraphics.java)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.draw(IOSGraphics.java)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.$cb$drawRect$(IOSGraphics.java)
    at org.robovm.apple.uikit.UIApplication.main(Native Method)
    at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
    at com.cereal.stackking.IOSLauncher.main(IOSLauncher.java)

1 个答案:

答案 0 :(得分:0)

Box2D使用本机代码中的反射来访问要调用联系人侦听器的java方法。 RoboVM是否有任何方法可以告诉树振荡器保留某些类/方法(la proguard)?如果没有,您可能必须坚持使用保守模式(并且可能使用RoboVM提交功能请求)。