【问题标题】:The application [name] has stopped unexpectedly. (AIR/FlashDevelop)应用程序 [name] 意外停止。 (AIR/Flash开发)
【发布时间】:2014-07-04 10:42:57
【问题描述】:

我是 Flash 和 Actionscript 的新手,我正在尝试构建一个测试应用程序以在 Android 设备或模拟器上运行。 (用 Flash 播放器运行它可以正常工作)。

当我在模拟器(基于 ARM)或真实设备(Nexus 7)上使用goto android-testRun.bat 中部署和运行我的测试APK 时,它会以The application [name] has stopped unexpectedly 终止。

另一方面,当我尝试使用goto android-debug 进行调试时,它只是出现了一个空白屏幕。

在 FlashDevelop 中,我没有看到进一步的日志消息表明设备或模拟器上发生了哪种错误。

之前我遇到了因为application.xml中的命名空间导致无法构建APK的问题,即:

<application xmlns="http://ns.adobe.com/air/application/14.0">

我想知道它是否从我在之前项目中设置的 Flash Player 版本中获得了14.0。将其更改为 3.1 以匹配我认为的 AIR 运行时版本后,它编译了 APK,但现在我遇到了这个问题。

我正在使用 Flex SDK 4.6FlashDevelop 4.6.2.5

这是我的主要课程:

package ceronio.net
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.ui.Multitouch;
    import flash.ui.MultitouchInputMode;

    /**
     * ...
     * @author Martin
     */
    public class Main extends Sprite 
    {

        public function Main():void 
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            stage.addEventListener(Event.DEACTIVATE, deactivate);

            // touch or gesture?
            Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
        }

        private function deactivate(e:Event):void 
        {
        }

    }

}

这是我的application.xml

<?xml version="1.0" encoding="utf-8" ?> 
<application xmlns="http://ns.adobe.com/air/application/3.1">

    <id>ceronio.net.mobile2</id>
    <versionNumber>0.1</versionNumber>
    <supportedProfiles>mobileDevice</supportedProfiles>
    <filename>mobile2</filename>

    <name>mobile2</name>
    <description></description>
    <copyright></copyright>

    <android>
        <manifestAdditions><![CDATA[

            <manifest android:installLocation="auto">
              <uses-sdk android:minSdkVersion="8"/>
                <uses-permission android:name="android.permission.INTERNET"/>
                <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
            </manifest>

        ]]></manifestAdditions>
    </android>
    <iPhone> 
        <InfoAdditions><![CDATA[ 

            <key>UIStatusBarStyle</key> 
            <string>UIStatusBarStyleBlackOpaque</string> 
            <key>UIRequiresPersistentWiFi</key> 
            <string>NO</string>
            <key>UIPrerenderedIcon</key>  
            <true/>
            <key>UIApplicationExitsOnSuspend</key>
            <true/>

            <key>UIDeviceFamily</key>
            <array>
                <!-- iPhone support -->
                <string>1</string> 
                <!-- iPad support -->
                <!--<string>2</string>-->
            </array>

        ]]></InfoAdditions> 
        <requestedDisplayResolution>high</requestedDisplayResolution>
    </iPhone> 

    <initialWindow>
        <title>mobile2</title>
        <content>mobile2.swf</content>
        <visible>true</visible>
        <fullScreen>true</fullScreen>
        <renderMode>direct</renderMode>
    </initialWindow>

    <icon>
        <image48x48>icons/icon_48.png</image48x48>
        <image57x57>icons/icon_57.png</image57x57>
        <image72x72>icons/icon_72.png</image72x72>
    </icon>

</application>

感谢 Hiemanshu 将我指向 logcat 的评论。使用它,我得到了以下日志,这让我怀疑它是否无法引用 AIR 运行时。不过,我确实按照说明首先使用 InstallAirRuntime.bat 部署了运行时。

D/dalvikvm(  659): Trying to load lib /data/data/com.adobe.air/lib/libCore.so 0x4051c380

I/dalvikvm(  659): Failed resolving Lcom/adobe/air/AIRWindowSurfaceView$2; interface 153 'Landroid/view/View$OnSystemUiVisibilityChangeListener;'

W/dalvikvm(  659): Link of class 'Lcom/adobe/air/AIRWindowSurfaceView$2;' failed

E/dalvikvm(  659): Could not find class 'com.adobe.air.AIRWindowSurfaceView$2', referenced from method com.adobe.air.AIRWindowSurfaceView.DoSetOnSystemUiVisibilityChangeListener

W/dalvikvm(  659): VFY: unable to resolve new-instance 213 (Lcom/adobe/air/AIRWindowSurfaceView$2;) in Lcom/adobe/air/AIRWindowSurfaceView;

D/dalvikvm(  659): VFY: replacing opcode 0x22 at 0x0000

D/dalvikvm(  659): VFY: dead code 0x0002-0008 in Lcom/adobe/air/AIRWindowSurfaceView;.DoSetOnSystemUiVisibilityChangeListener ()V

I/dalvikvm(  659): Could not find method android.view.View.setSystemUiVisibility, referenced from method com.adobe.air.AIRWindowSurfaceView.clearFullScreen

W/dalvikvm(  659): VFY: unable to resolve virtual method 395: Landroid/view/View;.setSystemUiVisibility (I)V

D/dalvikvm(  659): VFY: replacing opcode 0x6e at 0x001a

I/dalvikvm(  659): Could not find method android.view.View.setSystemUiVisibility, referenced from method com.adobe.air.AIRWindowSurfaceView.setFullScreen

W/dalvikvm(  659): VFY: unable to resolve virtual method 395: Landroid/view/View;.setSystemUiVisibility (I)V

D/dalvikvm(  659): VFY: replacing opcode 0x6e at 0x001c

I/dalvikvm(  659): Could not find method android.view.ScaleGestureDetector.getCurrentSpanX, referenced from method com.adobe.air.gestures.AIRGestureListener.onScale

W/dalvikvm(  659): VFY: unable to resolve virtual method 367: Landroid/view/ScaleGestureDetector;.getCurrentSpanX ()F

D/dalvikvm(  659): VFY: replacing opcode 0x74 at 0x0040

I/dalvikvm(  659): Could not find method android.view.ScaleGestureDetector.getPreviousSpanX, referenced from method com.adobe.air.gestures.AIRGestureListener.onScale

W/dalvikvm(  659): VFY: unable to resolve virtual method 372: Landroid/view/ScaleGestureDetector;.getPreviousSpanX ()F

D/dalvikvm(  659): VFY: replacing opcode 0x74 at 0x009a

D/dalvikvm(  659): VFY: dead code 0x0043-0067 in Lcom/adobe/air/gestures/AIRGestureListener;.onScale (Landroid/view/ScaleGestureDetector;)Z

D/dalvikvm(  659): VFY: dead code 0x009d-0115 in Lcom/adobe/air/gestures/AIRGestureListener;.onScale (Landroid/view/ScaleGestureDetector;)Z

D/dalvikvm(  659): VFY: dead code 0x0136-013a in Lcom/adobe/air/gestures/AIRGestureListener;.onScale (Landroid/view/ScaleGestureDetector;)Z

W/OrientationEventListener(  659): Cannot detect sensors. Not enabled

W/dalvikvm(  659): No implementation found for native Lcom/adobe/air/AIRWindowSurfaceView;.nativeOnFormatChangeListener (I)V

D/AndroidRuntime(  659): Shutting down VM

W/dalvikvm(  659): threadid=1: thread exiting with uncaught exception (group=0x40015560)

E/AndroidRuntime(  659): FATAL EXCEPTION: main

E/AndroidRuntime(  659): java.lang.UnsatisfiedLinkError: nativeOnFormatChangeListener

E/AndroidRuntime(  659):    at com.adobe.air.AIRWindowSurfaceView.nativeOnFormatChangeListener(Native Method)

E/AndroidRuntime(  659):    at com.adobe.air.AIRWindowSurfaceView.surfaceChanged(AIRWindowSurfaceView.java:683)

E/AndroidRuntime(  659):    at android.view.SurfaceView.updateWindow(SurfaceView.java:549)

E/AndroidRuntime(  659):    at android.view.SurfaceView.dispatchDraw(SurfaceView.java:348)

E/AndroidRuntime(  659):    at android.view.View.draw(View.java:6883)

E/AndroidRuntime(  659):    at android.view.SurfaceView.draw(SurfaceView.java:334)

E/AndroidRuntime(  659):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)

E/AndroidRuntime(  659):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)

E/AndroidRuntime(  659):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)

E/AndroidRuntime(  659):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)

E/AndroidRuntime(  659):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)

E/AndroidRuntime(  659):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)

E/AndroidRuntime(  659):    at android.view.View.draw(View.java:6883)

E/AndroidRuntime(  659):    at android.widget.FrameLayout.draw(FrameLayout.java:357)

E/AndroidRuntime(  659):    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1862)

E/AndroidRuntime(  659):    at android.view.ViewRoot.draw(ViewRoot.java:1522)

E/AndroidRuntime(  659):    at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)

E/AndroidRuntime(  659):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)

E/AndroidRuntime(  659):    at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime(  659):    at android.os.Looper.loop(Looper.java:123)

E/AndroidRuntime(  659):    at android.app.ActivityThread.main(ActivityThread.java:3683)

E/AndroidRuntime(  659):    at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime(  659):    at java.lang.reflect.Method.invoke(Method.java:507)

E/AndroidRuntime(  659):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)

E/AndroidRuntime(  659):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)

E/AndroidRuntime(  659):    at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager(   61):   Force finishing activity air.air.ceronio.net.mobile2/.AppEntry

W/ActivityManager(   61): Activity pause timeout for HistoryRecord{40628908 air.air.ceronio.net.mobile2/.AppEntry}

D/dalvikvm(  305): GC_EXPLICIT freed 8K, 54% free 2542K/5511K, external 1625K/2137K, paused 72ms

W/ActivityManager(   61): Activity destroy timeout for HistoryRecord{40628908 air.air.ceronio.net.mobile2/.AppEntry}

D/dalvikvm(  315): GC_EXPLICIT freed 2K, 54% free 2539K/5511K, external 1625K/2137K, paused 100ms

D/dalvikvm(  217): GC_EXPLICIT freed 12K, 55% free 2595K/5703K, external 1625K/2137K, paused 74ms

【问题讨论】:

  • 您能在其中添加一个 logcat 吗?
  • 啊,这听起来很有帮助。我从哪里得到那个?
  • 您可以使用forum.xda-developers.com/showthread.php?t=1726238 作为参考,了解如何操作。
  • 好的,在 Android 网站上找到了文档。将添加到帖子。非常感谢您的提示!
  • 您可以尝试在 Flex SDK 中覆盖 AIR SDK,这样您就可以确定您拥有最新的 SDK。以下是一些关于覆盖helpx.adobe.com/x-productkb/multi/… 的一般说明

标签: android actionscript-3 air flashdevelop


【解决方案1】:

在创建 actionscript AIR 项目时,任何时候都只有一个 AIR 版本可用,这与您可以针对不同 SDK 版本的 flex 项目相反。 FB 确实为您设置了正确的版本:14.0,这是您需要使用的版本。尝试将其设置为 3.1 只会产生错误。我认为在您的情况下,主要问题是您有大量错误和错误,这些错误和错误只会累积并导致整个项目失败。解决方案,从一个新的空项目重新开始,编译和测试,如果它不起作用,请返回这里的结果(这次这些结果不会与其他错误混合)。我的猜测是它会工作得很好,你只需要不搞乱项目设置。

【讨论】:

  • 我相信Flash版本是14.0,但AIR版本是3.1。
  • 3.1 是一个过时的版本,例如它不适用于 ios 发布。至于 Android,Adobe 建议使用最新的 AIR SDK 14.0 发布。为什么使用 2 年前过时的 SDK 发布对您来说如此重要?
【解决方案2】:

您可以尝试在 Flex SDK 中覆盖 AIR SDK,这样您就可以确定您拥有最新的 SDK。下面是一些关于覆盖http://helpx.adobe.com/x-productkb/multi/how-overlay-air-sdk-flex-sdk.html的一般说明

另外,我认为在 Flash Develop 中,您可以安装多个 Flex SDK 并选择适合您项目的一个。您可以在这里找到如何添加新的 SDK http://www.flashdevelop.org/wikidocs/index.php?title=Configuration#Configuring_the_Flex_SDK 然后您可以在 Flash Develop 中打开您的项目并转到 Project > Properties 并选择 3.9 SDK,它应该可以工作。我发现配置 Flash Develop 非常棘手。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-14
    • 2013-08-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多