Jump to content
limelect

Android does not start

Recommended Posts

D11.3 CE.

A simple program loads to S6 phone. just a button and label

Loading complex program shows only this screen

BRP here   Application.Initialize; does not stop or oncreate form either

So now how to debug ?

32bit

No errors just  stack

Screenshot_20230523_185102[1].jpg

Edited by limelect

Share this post


Link to post

A little history.

Same software was  compiled on D10.2.3 and WORKED !!!! on S2 phone.

when i moved to S6 phone the software did not work.

So i thought D11.3 will do the job.

So i thought but Embarcadero is stronger then me.

Never happened with Android studio

 

 

Share this post


Link to post

Hi

 

Did you upgraded the Android manifest template file to the need one for 11.3 ?

 

Did you updates the JAR libraries needed for the project in the project manager Android platform you compile ? (probably yes if it compiles, but check in case not)

 

If you transfer the APK manually to an other device, does it starts or not ?

 

Does the program starts when you compile it in DEBUG mode and start it with (or without) the debugger from the IDE ?

  • Like 3

Share this post


Link to post
10 minutes ago, Patrick PREMARTIN said:

Does the program starts when you compile it in DEBUG mode and start it with (or without) the debugger from the IDE ?

Sometimes, due to a shortcoming with the IDE, the application gets "stuck" or crashes before the debugger has a chance to attach to the process. This can happen when a library required at initialization time is not present, or is not the right version. Without detail about the project (of which none at all so far has been provided), it'll be very difficult to diagnose.

  • Like 1

Share this post


Link to post

1. I did try to install it by moving the APK to a directory on the phone -- the program does not start seeing

    only the icon as the picture shows

2. On a debug mode the form does not even start >>>> BRP here   Application.Initialize;

3. This is a program on S2 that worked perfectly with D10

4. All compilation works without any errors or warnings.

5. I deleted the Android manifest template so it made a new one.

6. I think I did all possible things with my knowledge

7. I expect moving from 10 to 11 and compiling, not so old program,

     will be without any problems.

8. All Java is there and seen without any problems

Share this post


Link to post
3 minutes ago, limelect said:

1. I did try to install it by moving... etc

None of that information is going to help resolve the issue. Detail about what is in the application may go part way to solving it. Ideally, provide a reproducible test case, which will go a much longer way.

Share this post


Link to post

This a window version for sending msg to WhatsApp

the same (with a little change of screen) for Android

 

1.thumb.png.a28c99a6f4fbbd1511646704045b84cb.png

Share this post


Link to post

One thing may be very important

For left-right to work on Android, I have

this files now I wonder if this is the problem

although I doubt  

 

I will try NOT to use this files and see what happenes

1725639615_Screenshot-29_05_202311_59_59.jpg.7c51dcdff4fb3736733bf0f3e58e07fc.jpg

Edited by limelect

Share this post


Link to post

Those files are not used so back to the basic problem

Edited by limelect

Share this post


Link to post

@Dave Nottage My problem has nothing to do with the kind of software

as the program does not even start on the phone

It has to do with d11 compilation.

Share this post


Link to post

May i sugest an impruvment

Embarcdero has to take my source and find out

what is going on. But they won't

Share this post


Link to post
1 minute ago, limelect said:

My problem has nothing to do with the kind of software

as the program does not even start on the phone

It has to do with d11 compilation.

I have projects from earlier versions of Delphi that I've successfully migrated to Delphi 11.x, mainly because I've been aware of any changes that may be necessary. It has everything to do with what is being used in the application, and zero to do with compilation. Since you appear to be unwilling to share anything about your app, it's extremely difficult to know what the issue is.

  • Like 3

Share this post


Link to post

@Dave Nottage  I will happily share with any serious programmer the source

I do not see ANY reason for the transfer problem

from D10.2.3 to D11. The components are standard

And if professionals like all of us have to start with a learning curve

it is not reasonable. After all, it is not like moving from

D7 to D11.

And especially that this software worked perfectly.

 

 

Edited by limelect

Share this post


Link to post
1 hour ago, limelect said:

I do not see ANY reason for the transfer problem

from D10.2.3 to D11. The components are standard

And if professionals like all of us have to start with a learning curve

it is not reasonable. After all, it is not like moving from

D7 to D11.

Android development is very different from Windows development. Most likely cause of problems are changes and requirements for newer Android OS that were introduced in the meantime. It has nothing to do with compiler nor Delphi language.

 

Google releases new Android version every year and to comply with those new OS releases and ability to upload applications on Play Store, Delphi Android applications need to support new OS and new Android SDK. There have been numerous changes between 10.2.3 and D11.3 considering Android development and your old application most likely uses features that were subject to change and that require additional or changed configurations or code. Without knowing which features you are using, it is impossible to say what needs to be changed.

 

You can find list of changes and new requirements between releases in official Android documentation https://developer.android.com/tools/releases/platforms 

 

Also Delphi Android application runs inside a wrapper and if application crashes due to misconfiguration inside that wrapper, it will crash before any Delphi code starts running. That is why you cannot debug it. To understand what is happening and why it crashed you need to look at native Android error logs - logcat. 

Edited by Dalija Prasnikar
  • Like 2

Share this post


Link to post
18 minutes ago, limelect said:

He found using logcat ( why I did not think about it ?) that there are problems with the java

So if compilation is OK how one is expected to debug? 

Again, if application crashes inside Java wrapper side, then you cannot debug it with Delphi. You need to see what is exact error message and then Google what feature is this error connected to. Then look at changed requirements in the official Android documentation and make appropriate changes.  Because native Java applications also suffer from same issues when upgrading, usually you can find plenty of resources which will give you answer about precise configurations needed even without going through official documentation.

 

Creating new Delphi application and then including those problematic features can also help to pinpoint exact problem. Most likely there is some configuration problem in your application manifest. But there could be other issues, like wrong JAR libraries and similar. 

 

Once you get new Delphi application up and running, you can see the differences in configuration and apply necessary changes to the old one.

Share this post


Link to post

@Dave Nottage found the problem it seems a directory was the problem

changing to System.IOUtils.TPath.GetDocumentsPath

Also, it seems that the debugger could not help

since the program failed before starting

only logcat helped

 

And again great thanks to Dave for his help

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×