Jump to content
Massimiliano S

Problem with Delphi RIO 10.3.3 and Google API Level 29

Recommended Posts

Hello

I need to upload a test app on the google store.
Unfortunately, the loading is not successful because Google requires at least a Level 29 for Android 10 as the target of the API while mine is 28.
I am using delphi rio 10.3.3

I updated the SDKs by also installing 29 and downloaded the android-ndk-r21d NDK version.

I then updated SDK manager set as android-29 target.

Unfortunately, delphi always compiles by setting in the manifest:
<uses-sdk android: minSdkVersion = "19" android: targetSdkVersion = "28" />

So I forced version 29 in the manifest template but unfortunately the app crashes

I read that Delphi RIO theoretically supported the Android 10 version but I could not find anything about my problem other than a 6 month old post with no solution
Has anyone found this problem yet?

Thanks

Massimiliano

 

Share this post


Link to post

Hello,

 

what please does "the app crashes" mean?

Is there any failure message? If yes , which?

Can you run monitor.bat from your Android SDK?

With that you can see the logcat log of your device. Run the app then until it crashes

and look at the log. Maybe there are helpful messages in it.

 

Have you looked into QP for any reports regarding this? Does one exist?

The app that you tried, was this created new in 10.3.3 or is it updated from some earlier version?

If the latter it might help to delete AndroidManifestTemplate and let the IDE regenerate it.
Then change targetSDKVersion. Maybe there were other changes in it as well.

 

Does the crash happen with a blank FMX app created in 10.3.3 as well?

 

Regards

TurboMagic

Share this post


Link to post

There are a number of reports of this on QP. Delphi 10.3.3 doesn’t support Android 10 (targeted with SDK 29) but Delphi 10.4 seems to work.

I also hope someone finds a workaround for 10.3.3 before the Google deadline, as 10.4 isn’t an option for us until it’s been made more stable.

Share this post


Link to post

For anyone following this thread, the relevant QP report is here:

 

  https://quality.embarcadero.com/browse/RSP-27218

 

As per my comment on the report (dated Aug 24), it would be possible to recompile System.pas (it needs a change to ICU.inc), however unfortunately, the files ex.android.arm.inc and ex.android.arm64.inc are not supplied, thus making it impossible without help from Embarcadero.

  • Thanks 1

Share this post


Link to post

I can't even vote because my subscription ran out...

Share this post


Link to post

Unfortunately there is no solution.
I had to uninstall delphi 10.3 and install 10.4
This isn't cool because 10.3.3 is ultimately very recent and it can't possibly not support the latest minimal APIs

Share this post


Link to post

And what about Embarcadero - they could make a patch for 10.3.3, so that each of us does not have to solve it by himself...

Share this post


Link to post

Doesn't look like there's going to be an official patch, but it took me less than 5min to get this done, so it's not that tedious.

 

Share this post


Link to post

Hey.
I tried to repeat the same and it worked, but there is one problem. Permissions don't work. when i want to open a file, file open denied message appears.
How to fix it? although I have all the permissions and the phone shows the permission has been granted.
thank

Share this post


Link to post

FMX: For Free: Error = Cannot open file "/storage/emulated/0/Documents/FSelfLocation.ini". Permission denied

FMX: For Free: Cannot open file "/storage/emulated/0/Documents/lglist.bin". Permission denied

Share this post


Link to post

You may need to add:

  android:requestLegacyExternalStorage="true"

To the <application> tag in AndroidManifest.template.xml

  • Like 1
  • Thanks 1

Share this post


Link to post
54 minutes ago, Dave Nottage said:

You may need to add:


  android:requestLegacyExternalStorage="true"

To the <application> tag in AndroidManifest.template.xml

[PAClient Error] Error: E6408 Unable to execute '"c:\program files (x86)\embarcadero\studio\20.0\bin\android\aapt2.exe" link --proto-format --auto-add-overlay -I "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\platforms\android-28\android.jar" --manifest "D:\Delphi\Isxodniki\Android\Gocha\NewVersion\For Free\Android64\Release\ForFree\AndroidManifest.xml" -R "D:\Delphi\Isxodniki\Android\Gocha\NewVersion\For Free\Android64\Release\ForFree\compiled_res.flata" -o "D:\Delphi\Isxodniki\Android\Gocha\NewVersion\For Free\Android64\Release\ForFree\linked_res.ap_"' (Error 1)

[PAClient Error] Error: E6408 D:\Delphi\Isxodniki\Android\Gocha\NewVersion\For Free\Android64\Release\ForFree\AndroidManifest.xml:34: error: attribute android:requestLegacyExternalStorage not found.

 

Quote

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

    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <permission android:name="com.welcomeapps.forfree.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="com.welcomeapps.forfree.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application android:persistent="False" 
        android:restoreAnyVersion="False" 
        android:label="For Free" 
        android:debuggable="False" 
        android:largeHeap="False"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/MyTheme.NoTitleBar.CustomBackground"
        android:hardwareAccelerated="true"
        android:usesCleartextTraffic="true"
        android:requestLegacyExternalStorage="true"
        android:resizeableActivity="false">

 

Share this post


Link to post

I tried another approach:

- manualy set targetSdkVersion to 29, published app in Google Play.

- now I have created an update with targetSdkVersion set to 28 and submitted to Google Play - it displayed a warning, but files were accepted.

  It seems that till November 2nd 2020, updates with targetSdkVersion=28 are accepted: https://developer.android.com/distribute/best-practices/develop/target-sdk

- after November 2nd 2020, I hope Delphi 10.4.1 will be mature enough, so that I can start using it.

 

 

Share this post


Link to post
On 9/3/2020 at 8:41 AM, Dave Nottage said:

You may need to add:


  android:requestLegacyExternalStorage="true"
 

To the <application> tag in AndroidManifest.template.xml

Hi Dave,

 

I've made my app works with Api 29 using the tutorial of Horacio Filho . The app run fine on my Xiaomi Mi 2 lite with android 10.

 

I only have a problem when taking photos with the camera or selecting photos from the gallery. With the Api 28 all was working fine.

 

Does this permissions also solve the problem of taking photos in Android 10  or is there another permission?

 

Regards

 

José

 

Share this post


Link to post

Hi Everyone,

 

When using the 

android:requestLegacyExternalStorage="true"

I Get an error  trying to run  my app to my android device or when trying to deploy the app

 

 [PAClient Error] Error: E2312 H:\Projectos\BimPlatformMobile\Android64\Release\BimMobile5\AndroidManifest.xml:37: error: Error parsing XML: not well-formed (invalid token)

 

Does anyone have this problem?

Share this post


Link to post
43 minutes ago, Jose Morango said:

 [PAClient Error] Error: E2312 H:\Projectos\BimPlatformMobile\Android64\Release\BimMobile5\AndroidManifest.xml:37: error: Error parsing XML: not well-formed (invalid token)

It's telling you exactly what the problem is, i.e. that the xml is invalid. It is likely because you have not correctly added the attribute you mentioned. The application tag should look like this:

On 9/3/2020 at 6:08 PM, Martifan said:

<application android:persistent="False" 
        android:restoreAnyVersion="False" 
        android:label="For Free" 
        android:debuggable="False" 
        android:largeHeap="False"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/MyTheme.NoTitleBar.CustomBackground"
        android:hardwareAccelerated="true"
        android:usesCleartextTraffic="true"
        android:requestLegacyExternalStorage="true"
        android:resizeableActivity="false">

 

Share this post


Link to post

Hi Dave,

thanks for the reply,

 

This is my manifest. If I remove the android:requestLegacyExternalStorage="true", then I'm able to compile and deploy the app.

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

    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <permission android:name="com.tecnicos.bim.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="com.tecnicos.bim.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application				 
		android:persistent="False" 
        android:restoreAnyVersion="False" 
        android:label="BIM Hospitality" 
        android:debuggable="True" 
        android:largeHeap="False"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/AppTheme"
        android:hardwareAccelerated="true"
	android:requestLegacyExternalStorage="true"
        android:resizeableActivity="false">

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="com.tecnicos.bim.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>
<provider
            android:name="com.embarcadero.firebase.provider.FirebaseInitProvider"
            android:authorities="com.tecnicos.bim.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100">
        </provider>

        <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/notification_accent_color" />
        <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_notification" />

        
        <service android:exported="false" android:name="com.embarcadero.firebase.messaging.ProxyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <service android:exported="true" android:name="com.google.firebase.messaging.FirebaseMessagingService">
            <intent-filter android:priority="-500">
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <service android:exported="false" android:name="com.google.firebase.components.ComponentDiscoveryService">
            <meta-data android:name="com.google.firebase.components:com.google.firebase.iid.Registrar" android:value="com.google.firebase.components.ComponentRegistrar" />
        </service>


        <!-- 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="BIM Hospitality"
                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="BimMobile5" />
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter> 
        </activity>
        
        
        <service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
        
        <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />
        <receiver android:exported="true" android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </receiver>

    </application>
</manifest>
<!-- END_INCLUDE(manifest) -->

 

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

×