Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app crashes on rotation to landscape #148

Closed
inclement opened this issue Aug 15, 2013 · 7 comments
Closed

Android app crashes on rotation to landscape #148

inclement opened this issue Aug 15, 2013 · 7 comments

Comments

@inclement
Copy link
Member

My kivy app crashes when rotated from portrait to landscape via phone rotation with the 'orientation=sensors' option. An example logcat output is at https://gist.github.com/inclement/6245730

I've tested with another (much simpler) app and got the same behaviour, and tshirtman reports also seeing it.

@tshirtman
Copy link
Member

I'm a bit confused, i compiled a debug distro yesterday to track it
down, and building toutchracer/showcase with orientation=sensors with it
got me two fully working apk, no crash when rotating. My debug build
mostly changes -O3 to -O0 and removes stripping of libs in python and
libs building in the distro.

On Thu, Aug 15, 2013 at 04:02:45PM -0700, Alexander Taylor wrote:

My kivy app crashes when rotated from portrait to landscape via phone rotation with the 'orientation=sensors' option. An example logcat output is at https://gist.github.com/inclement/6245730

I've tested with another (much simpler) app and got the same behaviour, and tshirtman reports also seeing it.


Reply to this email directly or view it on GitHub:
#148

@brousch
Copy link
Contributor

brousch commented Sep 12, 2013

The rotate crash will happen if you use a target SDK higher than 12. The default in py4a is 8, so you will not notice this problem unless you specify --sdk in the build command.

To fix this, we need to figure out what change in SDK 13 is causing the rotation to fail. Change information is at http://developer.android.com/reference/android/os/Build.VERSION_CODES.html#HONEYCOMB_MR2

@tshirtman
Copy link
Member

"New FEATURE_SCREEN_PORTRAIT and FEATURE_SCREEN_LANDSCAPE features were introduced in this release. Applications that target previous platform versions are assumed to require both portrait and landscape support in the device; when targeting Honeycomb MR1 or greater the application is responsible for specifying any specific orientation it requires"

Doh, maybe we just need to add these flags to the xml? >_>

@tito tito closed this as completed in cfda3e6 Oct 14, 2013
@brousch
Copy link
Contributor

brousch commented Oct 14, 2013

Did you try this fix with API <= 12 ? With API 13 and 14 it works, but with API 8,11, and 12 I get results like http://pastebin.com/7CZLwXZB

@tito tito reopened this Oct 15, 2013
@tito tito closed this as completed in 8f4d23a Oct 15, 2013
@brousch
Copy link
Contributor

brousch commented Oct 15, 2013

#8f4d23a allows the APK to compile on API <= 12, but the resulting app crashes if you rotate the screen.

@knappador
Copy link
Contributor

Is this still open on API < 12?

@miohtama
Copy link
Contributor

This happens to me too.

orientation = all in buildozer.spec. Rotating device crashes the application without very meaningful debug information. Buildozer default minapi settings.

Below is adb logcat.

03-12 22:31:22.447  4346  4383 I ActivityManager: Config changes=480 {1.0 310mcc260mnc en_US ldltr sw411dp w683dp h387dp 420dpi nrml land finger -keyb/v/h -nav/h s.32}
03-12 22:31:22.449  4346  5554 I InputReader: Reconfiguring input devices.  changes=0x00000004
03-12 22:31:22.450  4346  5554 I InputReader: Device reconfigured: id=7, name='synaptics_rmi4_i2c', size 1080x1920, orientation 1, mode 1, display id 0
03-12 22:31:22.464 30746 30762 I python  : [INFO              ] [Android     ] Must go into sleep mode, check the app
03-12 22:31:22.465 30746 30762 I python  : [INFO              ] [Android     ] App paused, now wait for resume.
03-12 22:31:22.474 30746 30746 W SDLSurface: onDestroy() called
03-12 22:31:22.475 30746 30746 D SDLSurface: onDestroy() stop requested, wait for an event from the app
03-12 22:31:22.477 30746 30762 I python  : [INFO              ] [Android     ] Android wants to close our app.
03-12 22:31:22.478 30746 30762 I python  : [INFO              ] [Base        ] Leaving application in progress...
03-12 22:31:22.504 29384 29384 D GeckoApplication: onConfigurationChanged: en_US, background: false
03-12 22:31:22.504 29384 29384 D GeckoLocales: No selected locale. No correction needed.
03-12 22:31:22.570 30746 30762 I python  : Python for android ended.
03-12 22:31:22.571 30746 30762 I art     : System.exit called, status: 0
03-12 22:31:22.572 30746 30762 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
03-12 22:31:22.595  4346 17793 D GraphicsStats: Buffer count: 9
03-12 22:31:22.595  4346  6180 I WindowState: WIN DEATH: Window{45f7fb5 u0 com.opensourcehacker.webkivy/org.renpy.android.PythonActivity}
03-12 22:31:22.595  4346  6180 W WindowManager: Force-removing child win Window{1f6018f u0 SurfaceView} from container Window{45f7fb5 u0 com.opensourcehacker.webkivy/org.renpy.android.PythonActivity}
03-12 22:31:22.602  4346 32119 W WindowManager: Failed looking up window
03-12 22:31:22.602  4346 32119 W WindowManager: java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@c2bed16 does not exist
03-12 22:31:22.602  4346 32119 W WindowManager:     at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8736)
03-12 22:31:22.602  4346 32119 W WindowManager:     at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8727)
03-12 22:31:22.602  4346 32119 W WindowManager:     at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1209)
03-12 22:31:22.602  4346 32119 W WindowManager:     at android.os.BinderProxy.sendDeathNotice(Binder.java:558)
03-12 22:31:22.602  4346 32119 I WindowState: WIN DEATH: null
03-12 22:31:22.611  4346  5774 I ActivityManager: Process com.opensourcehacker.webkivy:python (pid 30746) has died
03-12 22:31:22.612  4346  5774 W ActivityManager: Force removing ActivityRecord{bdeffaf u0 com.opensourcehacker.webkivy/org.renpy.android.PythonActivity t8017}: app died, no saved state
03-12 22:31:22.632  4346  5774 I ActivityManager: Config changes=480 {1.0 310mcc260mnc en_US ldltr sw411dp w411dp h659dp 420dpi nrml port finger -keyb/v/h -nav/h s.33}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants