Android UnsatisfiedLinkError打开媒体URI

时间:2016-06-19 10:30:05

标签: java android javafx dalvik javafxports

适用于JAVAFX的代码JDK 1.8使用javafxports构建APK后,Windows无法在Android上运行。

声音文件存储在APK中

Magnatron-debug.apk\assets\Application_resources.jar\sounds

文件名是。 /sounds/swoosh1.wav

完整URI为jar:file:/data/user/0/ie.murphysoftware.games.magnatron/app_dex/Application_resources.jar!/sounds/swoosh1.wav

令人讨厌的代码行

58   Media sound = new Media(resourceName);

查看跟踪,似乎需要一个库。

堆栈跟踪显示

06-19 11:16:24.626 12230-12411/ie.murphysoftware.games.magnatron E/AndroidRuntime: FATAL EXCEPTION: JavaFX Application Thread
Process: ie.murphysoftware.games.magnatron, PID: 12230
    java.lang.UnsatisfiedLinkError
        at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:211)
        at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
        at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
        at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$5(NativeMediaManager.java:113)
        at com.sun.media.jfxmediaimpl.NativeMediaManager$$Lambda$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(AccessController.java:60)
        at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:104)
        at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:75)
        at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:87)
        at com.sun.media.jfxmedia.MediaManager.canPlayContentType(MediaManager.java:64)
        at com.sun.media.jfxmedia.locator.Locator.init(Locator.java:427)
        at javafx.scene.media.Media.<init>(Media.java:399)
        at ie.murphysoftware.games.magnatron.sounds.PlaySound.play(PlaySound.java:58)
        at ie.murphysoftware.games.magnatron.objects2d.Cannon.shoot(Cannon.java:194)
        at ie.murphysoftware.games.magnatron.objects2d.Cannon.mouseReleased(Cannon.java:163)
        at ie.murphysoftware.games.magnatron.interaction.SetupEventHandler$5.handle(SetupEventHandler.java:53)
        at ie.murphysoftware.games.magnatron.interaction.SetupEventHandler$5.handle(SetupEventHandler.java:50)
        at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3728)
        at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3456)
        at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1732)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2465)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:350)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
        at java.security.AccessController.doPrivileged(AccessController.java:52)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$333(GlassViewEventHandler.java:385)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$2.get(Unknown Source)
        at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:404)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:384)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:549)
        at com.sun.glass.ui.View.notifyMouse(View.java:923)
        at com.sun.glass.ui.monocle.MonocleView.notifyMouse(MonocleView.java:116)
        at com.sun.glass.ui.monocle.MouseInput.notifyMouse(MouseInput.java:314)
        at com.sun.glass.ui.monocl

我错过了库加载吗?

谢谢, 麦克

0 个答案:

没有答案