Android - App在安装时运行,在重新打开时崩溃

时间:2016-02-13 19:08:48

标签: android libgdx

当我第一次将应用程序安装到我的设备上时,它运行正常。然后,如果我关闭它并重新打开它,应用程序将崩溃并显示下面的logcat消息。

我不认为关于libwvm.so的第一行与它有任何关系,因为它也会在安装时显示,但不会导致崩溃。

我不确定如何处理此消息,因为据我所知,它并未指向我可以尝试修复的代码中的任何内容。

我正在关注this教程,学习使用libGDX开发游戏。

任何帮助表示赞赏。谢谢!

02-13 11:01:59.292 13140-13156/? E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
02-13 11:02:01.317 13140-13154/? A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x76a96000 in tid 13154 (GLThread 823)
02-13 11:02:01.424 3254-3254/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-13 11:02:01.425 3254-3254/? A/DEBUG: Build fingerprint: 'google/bullhead/bullhead:6.0.1/MMB29Q/2480792:user/release-keys'
02-13 11:02:01.426 3254-3254/? A/DEBUG: Revision: 'rev_1.0'
02-13 11:02:01.426 3254-3254/? A/DEBUG: ABI: 'arm64'
02-13 11:02:01.427 3254-3254/? A/DEBUG: pid: 13140, tid: 13154, name: GLThread 823  >>> com.mypackage.name <<<
02-13 11:02:01.427 3254-3254/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x76a96000
02-13 11:02:01.462 3254-3254/? A/DEBUG:     x0   00000000be39c000  x1   0000000076a96000  x2   00000000000000a0  x3   0000000000000120
02-13 11:02:01.463 3254-3254/? A/DEBUG:     x4   0000000000000000  x5   0000000000000000  x6   00000000be39c000  x7   0000000000000000
02-13 11:02:01.463 3254-3254/? A/DEBUG:     x8   0000000000000000  x9   0000000000000000  x10  0000000000000120  x11  0000000000000000
02-13 11:02:01.463 3254-3254/? A/DEBUG:     x12  0000000000000000  x13  0000007f8b9ad468  x14  0000007f8b9ad458  x15  0000007f8b9ad4b8
02-13 11:02:01.464 3254-3254/? A/DEBUG:     x16  0000007f82329148  x17  0000007f900d4140  x18  0000000000000001  x19  0000000076a96120
02-13 11:02:01.464 3254-3254/? A/DEBUG:     x20  00000000be39c000  x21  0000000000000001  x22  0000000000000120  x23  0000000000000120
02-13 11:02:01.464 3254-3254/? A/DEBUG:     x24  0000000000000120  x25  0000000000000001  x26  0000000000000001  x27  0000000000000120
02-13 11:02:01.464 3254-3254/? A/DEBUG:     x28  0000000076a96000  x29  0000007f8b9ace60  x30  0000007f81e57f74
02-13 11:02:01.464 3254-3254/? A/DEBUG:     sp   0000007f8b9ace60  pc   0000007f900d4280  pstate 0000000020000000
02-13 11:02:01.468 3254-3254/? A/DEBUG:     #00 pc 000000000001c280  /system/lib64/libc.so (memcpy+312)
02-13 11:02:01.469 3254-3254/? A/DEBUG:     #01 pc 000000000025df70  /vendor/lib64/egl/libGLESv2_adreno.so (BltDevice::ExecFastCopyBlock(void*, void const*, unsigned int, unsigned int, unsigned int, unsigned int, BltRect const*, BltRect const*, int)+144)
02-13 11:02:01.650 3254-3254/? E/DEBUG: AM write failed: Broken pipe
02-13 11:02:01.675 4413-13173/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 112)
02-13 11:02:01.682 366-366/? E/lowmemorykiller: Error writing /proc/13140/oom_score_adj; errno=22
02-13 11:02:06.360 3321-3321/? E/QCALOG: [MessageQ] ProcessNewMessage: [LOWI-SERVER] unknown deliver target [OS-Agent]
02-13 11:02:32.344 6226-6226/? E/NetworkScheduler.SchedulerReceiver: Invalid parameter app
02-13 11:02:32.344 6226-6226/? E/NetworkScheduler.SchedulerReceiver: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
02-13 11:02:32.945 7266-7266/? E/clatd: plat_prefix/dns(ipv4only.arpa) status = 7/No address associated with hostname

我不认为这是一个logcat过滤问题。我选择了#34;没有过滤器&#34;在logcat和消息是相同的,除了最后几行,而不是如上所述:

02-13 12:02:54.902 3254-3254/? E/DEBUG: AM write failed: Broken pipe
02-13 12:02:54.923 4413-17149/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 112)
02-13 12:02:54.928 4413-4459/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 60)
02-13 12:03:22.680 4413-5547/? E/native: do suspend true
02-13 12:03:22.688 6053-6302/? E/NxpTml: _i2c_write() errno : 5
02-13 12:03:22.688 6053-6302/? E/NxpTml: PN54X - Error in I2C Write.....
02-13 12:03:22.689 6053-6304/? E/NxpHal: write error status = 0x1ff
02-13 12:03:22.689 6053-6267/? E/NxpHal: write_unlocked failed - PN54X Maybe in Standby Mode - Retry

Android Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mypackage.name"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/GdxTheme" >
        <activity
            android:name="com.mypackage.name.AndroidLauncher"
            android:label="@string/app_name" 
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

1 个答案:

答案 0 :(得分:0)

我认为最可能的原因是当游戏进入后台时OpenGL上下文正在发布。

许多基于OpenGL的游戏使用一个名为glSurfaceView的类来管理OpenGL表面,默认情况下,如果你从暂停状态返回后不小心重新初始化所有OpenGL对象,就会遇到这类崩溃,因为它们一切都失效了。在Ice Cream Sandwich中,添加了一个名为setPreserveEGLContextOnPause的函数,以便您在游戏进入后台后轻松请求OpenGL上下文保持活动状态。

经过一些粗略的研究(如果这是错误的,那么道歉)我相信libgdx使用它或类似的东西,但它可能无法工作,因为你没有在清单中指定min或target sdk版本。尝试在清单中添加这样的一行:

<uses-sdk android:targetSdkVersion="19"  android:minSdkVersion="14" />

uses-sdk标记的文档位于:http://developer.android.com/guide/topics/manifest/uses-sdk-element.html