2

I have created a fresh multi device application in Delphi 10.4.2. Applications created with this Delphi version should run without problems in Android 11 API LEVEL 30.

The test application is just an empty form, it does not have anything implemented and it does not do anyhting, it is just for testing puposes, since I want to isolate the reason why my real application doesn´t run.

I have made some tests, after some digging on google, but none of the found solutions worked.

All tests results in the same behaviuor, which are:

  • When debugging, an error message stating "Error running lib/gdbserver: couldn't reserve 655360 bytes of address space at 0x8000 for ...", then app shuts down.
  • When running without debug, application starts, 1 or 2 seconds after it shuts down without any message.

I have tryed to build the application with Delphi 10.4.2 default sdk settings (Taregeting API level 29), acording with some messages found on the internet, it should worked.

I also have installed android studio and downloaded API level 30, and tryed to build with it, also should work acording other posts found on the internet.

Here is the manifest template i´m using for the test application:

<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="%package%"
        android:versionCode="%versionCode%"
        android:versionName="%versionName%"
        android:installLocation="%installLocation%">

    <!-- This is the platform API where NativeActivity was introduced. -->
    <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
<%uses-permission%>
    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application android:persistent="%persistent%" 
        android:restoreAnyVersion="%restoreAnyVersion%" 
        android:label="%label%" 
        android:debuggable="%debuggable%" 
        android:largeHeap="%largeHeap%"
        android:requestLegacyExternalStorage="true"            
        android:icon="%icon%"
        android:theme="%theme%"
        android:hardwareAccelerated="%hardwareAccelerated%">

<%application-meta-data%>
        <%services%>
        <!-- Our activity is a subclass of the built-in NativeActivity framework class.
             This will take care of integrating with our NDK code. -->
        <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                android:label="%activityLabel%"
                android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                android:launchMode="singleTask">
            <!-- Tell NativeActivity the name of our .so -->
            <meta-data android:name="android.app.lib_name"
                android:value="%libNameValue%" />
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter> 
        </activity>
        <%activity%>
        <%receivers%>
    </application>
</manifest>
<!-- END_INCLUDE(manifest) -->

I must say, that the tests are being conducted with the 32 bit oficial android emulator API level 30, on a windows 64bit environment.

This emulator image is able to execute arm applications.

The reason this tests are being conducted is that all customers that have upgraded to android 11 complained about the situation mentioned. (App shuts down after few seconds).

After trying every solution on google without success, I don´t know what else to do.

Any tips?

Thanx in advance.

Leo Bruno
  • 474
  • 3
  • 16

2 Answers2

1

android:requestLegacyExternalStorage="true" is not permitted if sdktarget is 30 try to remove this

giuseppe
  • 11
  • 1
0

I had same problem for android apps generated by delphi 10.1 berlin but when my phone upgraded to android 12, suddenly my apps run! The interesting matter was this: I even never recompiled my apps! I think there is some bug in Android 11 and it is now resolved in Android 12!

Irani
  • 1
  • 1