一段时间后,使用libgdx的Android应用程序被推送到后台。

时间:2022-05-13 04:48:27

I decided to retype the question since i gain more insight into the problem:

我决定重新回答这个问题,因为我对这个问题有了更多的了解:

Hi, I am quite despaired! Please help me! I invested so much time in this app and can't find the solution to this bug since 2 weeks!

嗨,我很失望!请帮助我!我花了这么多时间在这个应用程序上,从两周后就找不到这个bug的解决方案!

App description: I developed an app for android with the LibGdx engine. It's a jump and run game. Hereby Box2d is modeling the physic, a tiled map is rendered, a object parser is creating the objects, all data is managed with the asset manager, a stage which contains tables for the menu/HUD - ask for more detail if necessary!

应用程序描述:我开发了一个android应用程序,使用LibGdx引擎。这是一个跳跃和奔跑的游戏。在这里,Box2d正在对物理模型进行建模,绘制了一个tiled地图,一个对象解析器正在创建对象,所有的数据都是由asset manager管理的,这个阶段包含了菜单/HUD的表——如果有必要,还需要更多的细节!

Problem description (The bug is only (!) occurring on real devices (yes - I tried more then one device)): After playing some levels the app is suddenly pushed to the background without any notification or something. After resuming the app via the task manager the app restarts. This happen randomly after a couple of minutes.

问题描述(bug只是发生在真实设备上(是的,我尝试了更多的设备)):在玩了一些级别之后,应用程序突然被推送到后台,没有任何通知。通过任务管理器恢复应用程序后,应用程序重新启动。这是在几分钟后随机发生的。

Logcat-output in "API-USB-Debug-mode":

在“API-USB-Debug-mode Logcat-output”:

No specific error for the app-pid when the app crashes - ask if your are still interested in!

当应用程序崩溃时,app-pid没有特定的错误——询问您是否仍然感兴趣!

This system-wide output always occur a couple of seconds before the crash occurs:

系统范围的输出总是在崩溃发生前几秒钟发生:

01-29 21:07:51.915: W/InputDispatcher(2345): channel '421c2b38 com.android.launcher3/com.android.launcher3.Launcher (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
01-29 21:07:51.915: E/InputDispatcher(2345): channel '421c2b38 com.android.launcher3/com.android.launcher3.Launcher (server)' ~ Channel is unrecoverably broken and will be disposed!
01-29 21:07:51.915: I/WindowState(2345): WIN DEATH: Window{421c2b38 u0 com.android.launcher3/com.android.launcher3.Launcher}
01-29 21:07:51.920: W/InputDispatcher(2345): Attempted to unregister already unregistered input channel '421c2b38 com.android.launcher3/com.android.launcher3.Launcher (server)'

After the this lines the app always crash and the following lines are printed:

在这几行之后,应用程序总是崩溃,下面的几行打印出来:

01-29 21:07:56.290: I/ActivityManager(2345): Process com.google.process.location (pid 18862) has died.
01-29 21:07:56.300: I/ActivityManager(2345): Process com.facebook.katana (pid 19483) has died.
01-29 21:08:05.035: D/lights(2345): set_light_buttons: 1
01-29 21:08:08.800: I/ActivityManager(2345): Process com.android.inputmethod.latin (pid 18611) has died.
01-29 21:08:08.815: W/InputMethodManagerService(2345): Session failed to close due to remote exception
01-29 21:08:08.815: W/InputMethodManagerService(2345): android.os.DeadObjectException
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at android.os.BinderProxy.transact(Native Method)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.internal.view.IInputMethodSession$Stub$Proxy.finishSession(IInputMethodSession.java:292)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.server.InputMethodManagerService.finishSessionLocked(InputMethodManagerService.java:1373)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.server.InputMethodManagerService.clearClientSessionLocked(InputMethodManagerService.java:1364)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.server.InputMethodManagerService.clearCurMethodLocked(InputMethodManagerService.java:1390)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.server.InputMethodManagerService.onServiceDisconnected(InputMethodManagerService.java:1409)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1115)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1129)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at android.os.Handler.handleCallback(Handler.java:733)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at android.os.Handler.dispatchMessage(Handler.java:95)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at android.os.Looper.loop(Looper.java:136)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.server.ServerThread.initAndLoop(SystemServer.java:1223)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.server.SystemServer.main(SystemServer.java:1309)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at java.lang.reflect.Method.invokeNative(Native Method)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at java.lang.reflect.Method.invoke(Method.java:515)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-29 21:08:08.815: W/InputMethodManagerService(2345):  at dalvik.system.NativeStart.main(Native Method)
01-29 21:08:10.040: D/lights(2345): set_light_buttons: 2
01-29 21:08:15.270: D/lights(2345): set_light_buttons: 1
01-29 21:08:20.275: D/lights(2345): set_light_buttons: 2
01-29 21:08:21.560: I/ActivityManager(2345): Process archenoah.bounce (pid 19251) has died.
01-29 21:08:21.560: W/ActivityManager(2345): Force removing ActivityRecord{41fe9cb8 u0 archenoah.bounce/.MainActivity t233}: app died, no saved state
01-29 21:08:21.565: I/WindowState(2345): WIN DEATH: Window{41f9f330 u0 archenoah.bounce/archenoah.bounce.MainActivity}
01-29 21:08:21.580: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x400e3798 successful
01-29 21:08:21.580: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x400e4278 successful
01-29 21:08:21.580: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x400e41a8 successful
01-29 21:08:21.580: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x40cca488 successful
01-29 21:08:21.580: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x40cca3d8 successful
01-29 21:08:21.590: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x40cca2b0 successful
01-29 21:08:21.590: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x400e3130 successful
01-29 21:08:21.590: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x4007ae78 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x41192a88 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x411929d0 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x41192900 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x40dd8d18 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x40fd9ba0 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x40fd9a78 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x41192e20 successful
01-29 21:08:21.595: I/OMXNodeInstance(1907): OMX_FreeBuffer for buffer header 0x41192c10 successful
01-29 21:08:21.595: W/WindowManager(2345): Force-removing child win Window{41fa6e20 u0 SurfaceView} from container Window{41f9f330 u0 archenoah.bounce/archenoah.bounce.MainActivity}
01-29 21:08:21.620: W/WindowManager(2345): Failed looking up window
01-29 21:08:21.620: W/WindowManager(2345): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41fd0e58 does not exist
01-29 21:08:21.620: W/WindowManager(2345):  at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7965)
01-29 21:08:21.620: W/WindowManager(2345):  at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7956)
01-29 21:08:21.620: W/WindowManager(2345):  at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1047)
01-29 21:08:21.620: W/WindowManager(2345):  at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
01-29 21:08:21.620: W/WindowManager(2345):  at dalvik.system.NativeStart.run(Native Method)
01-29 21:08:21.625: I/WindowState(2345): WIN DEATH: null
01-29 21:08:21.665: I/ActivityManager(2345): Start proc com.android.launcher3 for activity com.android.launcher3/.Launcher: pid=19692 uid=10110 gids={50110, 1028}
01-29 21:08:22.710: I/ActivityManager(2345): Config changes=480 {1.0 262mcc1mnc en_GB ldltr sw360dp w360dp h615dp 320dpi nrml long port finger -keyb/v/h -nav/h s.152 themeResource=null}
01-29 21:08:22.725: I/InputReader(2345): Reconfiguring input devices.  changes=0x00000004
01-29 21:08:22.725: I/InputReader(2345): Device reconfigured: id=11, name='sec_touchscreen', size 720x1280, orientation 0, mode 1, display id 0
01-29 21:08:22.730: I/InputReader(2345): Reconfiguring input devices.  changes=0x00000004
01-29 21:08:22.755: D/PhoneStatusBar(12447): mSettingsPanelGravity = 55
01-29 21:08:22.920: I/ActivityManager(2345): Start proc android.process.acore for content provider com.android.providers.contacts/.ContactsProvider2: pid=19705 uid=10001 gids={50001, 3003, 1028, 1015}
01-29 21:08:23.000: V/Launcher(19692): LauncherAppState inited
01-29 21:08:23.070: W/Launcher(19692): setApplicationContext called twice! old=com.android.launcher3.LauncherApplication@41f544d8 new=com.android.launcher3.LauncherApplication@41f544d8
01-29 21:08:23.305: I/DeviceProfile.render()(19692): Showing searchbar.
01-29 21:08:23.440: I/ContactLocale(19705): AddressBook Labels [en_GB]: [, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, Α, Β, Γ, Δ, Ε, Ζ, Η, Θ, Ι, Κ, Λ, Μ, Ν, Ξ, Ο, Π, Ρ, Σ, Τ, Υ, Φ, Χ, Ψ, Ω, , А, Б, В, Г, Д, Е, Є, Ж, З, И, І, Ї, Й, К, Л, М, Н, О, П, Р, С, Т, У, Ф, Х, Ц, Ч, Ш, Щ, Ю, Я, , א, ב, ג, ד, ה, ו, ז, ח, ט, י, כ, ל, מ, נ, ס, ע, פ, צ, ק, ר, ש, ת, , ا, ب, ت, ث, ج, ح, خ, د, ذ, ر, ز, س, ش, ص, ض, ط, ظ, ع, غ, ف, ق, ك, ل, م, ن, ه, و, ي, , ก, ข, ฃ, ค, ฅ, ฆ, ง, จ, ฉ, ช, ซ, ฌ, ญ, ฎ, ฏ, ฐ, ฑ, ฒ, ณ, ด, ต, ถ, ท, ธ, น, บ, ป, ผ, ฝ, พ, ฟ, ภ, ม, ย, ร, ฤ, ล, ฦ, ว, ศ, ษ, ส, ห, ฬ, อ, ฮ, , ㄱ, ㄴ, ㄷ, ㄹ, ㅁ, ㅂ, ㅅ, ㅇ, ㅈ, ㅊ, ㅋ, ㅌ, ㅍ, ㅎ, , あ, か, さ, た, な, は, ま, や, ら, わ, #, ]
01-29 21:08:24.225: D/libEGL(19692): loaded /system/lib/egl/libEGL_mali.so
01-29 21:08:24.240: D/libEGL(19692): loaded /system/lib/egl/libGLESv1_CM_mali.so
01-29 21:08:24.260: D/libEGL(19692): loaded /system/lib/egl/libGLESv2_mali.so
01-29 21:08:24.300: E/(19692): Device driver API match
01-29 21:08:24.300: E/(19692): Device driver API version: 23
01-29 21:08:24.300: E/(19692): User space API version: 23 
01-29 21:08:24.305: E/(19692): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct  9 21:05:57 KST 2013 
01-29 21:08:24.465: D/OpenGLRenderer(19692): Enabling debug mode 0
01-29 21:08:24.540: I/ActivityManager(2345): Displayed com.android.launcher3/.Launcher: +2s891ms
01-29 21:08:24.540: I/ActivityManager(2345): Timeline: Activity_windows_visible id: ActivityRecord{425d6958 u0 com.android.launcher3/.Launcher t1} time:107475229
01-29 21:08:24.605: W/InputMethodManagerService(2345): Got RemoteException sending setActive(false) notification to pid 19251 uid 10131
01-29 21:08:24.625: D/LightsService(2345): Excessive delay setting light: 65ms
01-29 21:08:24.625: I/ActivityManager(2345): Start proc com.android.inputmethod.latin for service com.android.inputmethod.latin/.LatinIME: pid=19730 uid=10026 gids={50026, 1028, 1015}
01-29 21:08:24.625: V/InputMethodManagerService(2345): Adding window token: android.os.Binder@4231b288
01-29 21:08:24.675: I/ActivityManager(19692): Timeline: Activity_idle id: android.os.BinderProxy@41f4eae0 time:107475364
01-29 21:08:24.785: I/LatinIME(19730): Hardware accelerated drawing: true
01-29 21:08:24.940: I/WindowManager(2345): Screen frozen for +3s198ms due to Window{42bb8230 u0 com.android.systemui.ImageWallpaper}
01-29 21:08:24.950: W/InputAttributes(19730): No editor info for this field. Bug?
01-29 21:08:24.970: I/ResourceUtils(19730): Find override value: resource=keypress_vibration_durations build=[HARDWARE=smdk4x12 MODEL=GT-I9300 BRAND=samsung MANUFACTURER=samsung] override=8
01-29 21:08:24.970: I/ResourceUtils(19730): Found default value: resource=keypress_volumes build=[HARDWARE=smdk4x12 MODEL=GT-I9300 BRAND=samsung MANUFACTURER=samsung] default=-1.0f
01-29 21:08:24.990: I/LatinIME:LogUtils(19730): Dictionary info: dictionary = userunigram.de.dict ; version = ? ; date = ?
01-29 21:08:24.995: I/LatinIME:LogUtils(19730): Dictionary info: dictionary = UserHistoryDictionary.de.dict ; version = ? ; date = 1390835364
01-29 21:08:25.000: I/LatinIME:LogUtils(19730): Dictionary info: dictionary = personalization.de.dict ; version = ? ; date = 1390835364
01-29 21:08:25.000: I/LatinIME:LogUtils(19730): Dictionary info: dictionary = PersonalizationPredictionDictio ; version = ? ; date = 1390835364
01-29 21:08:25.030: V/RenderScript(19692): 0x5db8d108 Launching thread(s), CPUs 4
01-29 21:08:25.035: I/LatinIME:LogUtils(19730): Dictionary info: dictionary = main:de ; version = 40 ; date = 1380519383
01-29 21:08:26.585: W/BackupManagerService(2345): dataChanged but no participant pkg='com.android.launcher3' uid=10110
01-29 21:08:26.595: W/BackupManagerService(2345): dataChanged but no participant pkg='com.android.launcher3' uid=10110
01-29 21:08:26.620: W/BackupManagerService(2345): dataChanged but no participant pkg='com.android.launcher3' uid=10110
01-29 21:08:26.635: W/BackupManagerService(2345): dataChanged but no participant pkg='com.android.launcher3' uid=10110
01-29 21:08:26.655: W/BackupManagerService(2345): dataChanged but no participant pkg='com.android.launcher3' uid=10110
01-29 21:10:43.550: D/LightsService(2345): Excessive delay setting light: 81ms
01-29 21:11:00.520: D/LightsService(2345): Excessive delay setting light: 65ms

1 个解决方案

#1


0  

I finally found the mistake...When I'm setting a tiled map dynamically after every level this lead to an error...Since i hadn't any specific exception, this error was very hard to find...I solved it with saving the maps in an array at the start and receive it during run time instead of recreating the map every time.

我终于发现了错误……当我在每一层之后动态地设置一个倾斜的地图,这会导致一个错误……由于我没有任何特殊的例外,这个错误很难找到……我在开始时保存了数组中的映射,并在运行时接收它,而不是每次都重新创建映射。

map.add(new TmxMapLoader().load("data/maps/menu.tmx"));

地图。添加(新TmxMapLoader().load(“数据/地图/ menu.tmx”));

Do anyone know what the problem was?

有人知道是什么问题吗?

Thanks for your help anyway!

无论如何,谢谢你的帮助!

#1


0  

I finally found the mistake...When I'm setting a tiled map dynamically after every level this lead to an error...Since i hadn't any specific exception, this error was very hard to find...I solved it with saving the maps in an array at the start and receive it during run time instead of recreating the map every time.

我终于发现了错误……当我在每一层之后动态地设置一个倾斜的地图,这会导致一个错误……由于我没有任何特殊的例外,这个错误很难找到……我在开始时保存了数组中的映射,并在运行时接收它,而不是每次都重新创建映射。

map.add(new TmxMapLoader().load("data/maps/menu.tmx"));

地图。添加(新TmxMapLoader().load(“数据/地图/ menu.tmx”));

Do anyone know what the problem was?

有人知道是什么问题吗?

Thanks for your help anyway!

无论如何,谢谢你的帮助!