Jump to content
santycg

Delphi 11.2 + Android sdk 31 = "black screen"

Recommended Posts

HI!

 

Google requires the minimum sdk version 31 to upload/update apps to the Play Console.

 

I have updated the targetSdkVersion version in the AndroidManifest XML file manually to 31 instead of %targetSdkVersion%.

I also read in another post that I had to add android:exported="true" in the application section.

 

However, if I run the app in device, I only see a black screen and nothing happens. The app worked perfectly with previous targetSdkVersion (30).

 

Is there anything else I have to do for preparing my app for sdk 31, 32?

 

Thanks!

Share this post


Link to post
6 hours ago, santycg said:

However, if I run the app in device, I only see a black screen and nothing happens. The app worked perfectly with previous targetSdkVersion (30).

One reason may be that your startup code is attempting to access something that requires additional runtime permissions. I suggest using a logcat viewer to see what warnings or errors are emitted - personally, I use Device Lens (my own product). Alternatively, isolate what your code does at startup (including components on the main form that access OS resources e.g. Bluetooth) until you find the culprit.

  • Like 1

Share this post


Link to post

Hi, Dave.

 

Thanks for your suggestion. I will check this and even try to create a new blank project, step by step, replicating the one that fails, to see what's causing the issue.

 

I think that maybe it is related to file access permissions. The first form used in my apps is just a custom 'splash form'. Nothing else.

 

I remember a few years ago it was needed to create an .XML file with some info regarding file paths.

 

Or perhaps I have been including unnecessary files in the deployment that are not needed anymore, as these apps were initially created with Delphi XE, then Seattle, then Rio and now Alexandria.

 

I will post the solution if I found it.

 

Thanks!

  • Like 1

Share this post


Link to post

Finally I found the problem.

 

If I add FMX.PhoneDialer.pas unit to the project, I get the black screen!

 

Even with the PhoneDialer DEMO project in "Studio\22.0\Samples\Object Pascal\Mobile Snippets\PhoneDialer" folder, I can't get it to work in my device!

 

Even the demo project has the "call phone" permission checked and ask for the permission when launching the app, BUT I can't run the app in my device! It just shows the splash icon and then stucks!

 

Can someone try to Run (F9) the PhoneDialer DEMO project and reproduce it?

 

Build Configuration: Release

Target: Android 32 -> Development

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

×