Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Delphi 10 Seattle (Android) - Screen Rotation Crashes App



Permlink Replies: 13 - Last Post: May 13, 2016 12:40 AM Last Post By: Malcolm Taylor
Jeremy Praay

Posts: 9
Registered: 1/11/01
Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 7:57 AM
Steps to duplicate.

Create a form. Compile for Android using Delphi 10. Run. Rotate the screen.

This seems to happen every time, and I've tested it on multiple devices.

Suggestions appreciated. I'm about ready to give up on Firemonkey altogether.

EDIT: No error information (no Access Violation). It simply exits the app, even when I run it through the debugger.

Tested on Android 4.4.2 and Android 5, using Samsung Galaxy S4 mini, and Galaxy S5.

Edited by: Jeremy Praay on Nov 6, 2015 8:44 AM
Ken Randall

Posts: 130
Registered: 11/12/99
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 8:02 AM   in response to: Jeremy Praay in response to: Jeremy Praay
I have no problem on a Nexus 7 running Android 6.

Ken

Jeremy Praay wrote:

Steps to duplicate.

Create a form. Compile for Android using Delphi 10. Run. Rotate
the screen.

This seems to happen every time, and I've tested it on multiple
devices.

Suggestions appreciated. I'm about ready to give up on Firemonkey
altogether.
Jeremy Praay

Posts: 9
Registered: 1/11/01
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 8:12 AM   in response to: Ken Randall in response to: Ken Randall
Ken Randall wrote:
I have no problem on a Nexus 7 running Android 6.

Ken

Thanks.

The 2 devices that I have handy are both Android 4.4.2.

Just tested on Android 5.0 also. Same problem.

Edited by: Jeremy Praay on Nov 6, 2015 8:40 AM
Chris Dunn

Posts: 160
Registered: 8/22/11
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 9:52 AM   in response to: Jeremy Praay in response to: Jeremy Praay
did you check to make sure your classes.dex is current in DEPLOYMENT and that there aren't more than 1 being deployed.
Ive had similar issues.
also my android SDK tools are 24.3.3 Android SDK Platform tools are 23.
William Brookfi...

Posts: 55
Registered: 1/1/10
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 11:56 AM   in response to: Chris Dunn in response to: Chris Dunn
Chris Dunn wrote:
did you check to make sure your classes.dex is current in DEPLOYMENT and that there aren't more than 1 being deployed.
Ive had similar issues.
also my android SDK tools are 24.3.3 Android SDK Platform tools are 23.

I also have the exact same issue. also running SDK 24.3.3.

Built a hello word app from scratch only Tedit and Tlabel on single form

If I set custom Orientations
Application.FormFactor.Orientations := [TFormOrientation.Landscape, TFormOrientation.InvertedLandscape];
or
Application.FormFactor.Orientations := [TFormOrientation.Landscape];

And try and start the app in portrait the app crashes. If I rotate the phone to landscape and start the app it works,
If i use no custom Orientations then the app starts, but crashes when I rotate..
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 1:09 PM   in response to: William Brookfi... in response to: William Brookfi...
Am 06.11.2015 um 20:56 schrieb William Brookfield:
Chris Dunn wrote:
did you check to make sure your classes.dex is current in DEPLOYMENT and that there aren't more than 1 being deployed.
Ive had similar issues.
also my android SDK tools are 24.3.3 Android SDK Platform tools are 23.

I also have the exact same issue. also running SDK 24.3.3.

Built a hello word app from scratch only Tedit and Tlabel on single form

If I set custom Orientations
Application.FormFactor.Orientations := [TFormOrientation.Landscape, TFormOrientation.InvertedLandscape];
or
Application.FormFactor.Orientations := [TFormOrientation.Landscape];

And try and start the app in portrait the app crashes. If I rotate the phone to landscape and start the app it works,
If i use no custom Orientations then the app starts, but crashes when I rotate..

Hello,

what does your Android manifest file contain?
There is one setting in there influencing this.
At least in former times when you changed the SDK level the app was
menat for to get rid of the superlous overflow menu right from the
navigation keys and you didn't add something to that other setting (late
evening here - forgot which one) it would crash on rotation.

Be sure to check the manifest xml file in your source directory, as the
one in the Android subdir will be replaced by it on compiling.

Greetings

Markus
Chris Dunn

Posts: 160
Registered: 8/22/11
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 1:50 PM   in response to: Markus Humm in response to: Markus Humm
you are correct.
I reproduced and solved this. Delete your AndroidManifest.template.xml let Delphi generate a new one.
if you've upgraded Delphi and your not saving your projects to separate folders, your probly using Delphi xe8 AndroidManifest.template.xml generated in your default project directory.
William Brookfi...

Posts: 55
Registered: 1/1/10
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 7, 2015 12:30 PM   in response to: Chris Dunn in response to: Chris Dunn
Chris Dunn wrote:
you are correct.
I reproduced and solved this. Delete your AndroidManifest.template.xml let Delphi generate a new one.
if you've upgraded Delphi and your not saving your projects to separate folders, your probly using Delphi xe8 AndroidManifest.template.xml generated in your default project directory.

That did it. Appears that the line that resolves the issue in AndroidManifest.template.xml is
Old Value: android:configChanges="orientation|keyboardHidden">

New Value: android:configChanges="orientation|keyboard|keyboardHidden|screenSize"

Thanks to Chris Dunn for finding the solution.
Jeremy Praay

Posts: 9
Registered: 1/11/01
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2015 5:07 AM   in response to: Markus Humm in response to: Markus Humm
what does your Android manifest file contain?
There is one setting in there influencing this.
At least in former times when you changed the SDK level the app was
menat for to get rid of the superlous overflow menu right from the
navigation keys and you didn't add something to that other setting (late
evening here - forgot which one) it would crash on rotation.

Be sure to check the manifest xml file in your source directory, as the
one in the Android subdir will be replaced by it on compiling.

Yep. That fixed it for me! I just deleted the manifest and all was good. :-)

Thanks!
Remi Arts

Posts: 40
Registered: 11/15/13
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2016 12:12 AM   in response to: Markus Humm in response to: Markus Humm
Hi, I have a simular problem but I have a new manifest.
My Delphi 10 apps crash a lot of the times on Android versions below 6. They mostly crash after closing a form!
My XE8 versions of the apps work fine for Android versions below 6 but not for Android 6.

I've tried to debug, but it just closes the app without any messages or debug information.
Barry Dirks Dirks

Posts: 6
Registered: 2/25/07
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 12, 2016 11:30 AM   in response to: Remi Arts in response to: Remi Arts
Remi Arts wrote:
Hi, I have a simular problem but I have a new manifest.
My Delphi 10 apps crash a lot of the times on Android versions below 6. They mostly crash after closing a form!
My XE8 versions of the apps work fine for Android versions below 6 but not for Android 6.

I've tried to debug, but it just closes the app without any messages or debug information.

I'm running 10.1 Berlin and I deleted the AndroidManifest.xml file; in fact I deleted the entire Android folder. But when I re-deployed it still contains this:
android:configChanges="orientation|keyboard|keyboardHidden"

So maybe it's been broken again in the Berlin release?

-Barry

Edited by: Barry Dirks on May 12, 2016 2:31 PM

Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 12, 2016 1:56 PM   in response to: Barry Dirks Dirks in response to: Barry Dirks Dirks
Barry Dirks wrote:
Remi Arts wrote:
Hi, I have a simular problem but I have a new manifest.
My Delphi 10 apps crash a lot of the times on Android versions below 6. They mostly crash after closing a form!
My XE8 versions of the apps work fine for Android versions below 6 but not for Android 6.

I've tried to debug, but it just closes the app without any messages or debug information.

I'm running 10.1 Berlin and I deleted the AndroidManifest.xml file; in fact I deleted the entire Android folder. But when I re-deployed it still contains this:
android:configChanges="orientation|keyboard|keyboardHidden"

So maybe it's been broken again in the Berlin release?

-Barry


Delete or edit the AndroidManifestTemplate.XML file

Markus
Barry Dirks Dirks

Posts: 6
Registered: 2/25/07
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 12, 2016 7:25 PM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Barry Dirks wrote:
Remi Arts wrote:
Hi, I have a simular problem but I have a new manifest.
My Delphi 10 apps crash a lot of the times on Android versions below 6. They mostly crash after closing a form!
My XE8 versions of the apps work fine for Android versions below 6 but not for Android 6.

I've tried to debug, but it just closes the app without any messages or debug information.

I'm running 10.1 Berlin and I deleted the AndroidManifest.xml file; in fact I deleted the entire Android folder. But when I re-deployed it still contains this:
android:configChanges="orientation|keyboard|keyboardHidden"

So maybe it's been broken again in the Berlin release?

-Barry


Delete or edit the AndroidManifestTemplate.XML file

Markus

I did delete that file. I said I deleted the entire Android folder. You can't edit that file because it gets recreated every time you compile and deploy.

-Barry
Malcolm Taylor

Posts: 148
Registered: 7/16/01
Re: Delphi 10 Seattle (Android) - Screen Rotation Crashes App
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 13, 2016 12:40 AM   in response to: Barry Dirks Dirks in response to: Barry Dirks Dirks
Hi Barry

You said you deleted the file AndroidManifest.xml
But Marcus suggested deleting the file AndroidManifestTemplate.XML
(Note the 'Template' part)

The 'Template' version in your Project folder is used when re-building
the ones under your Android folder.

Malcolm
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02