【发布时间】:2021-08-04 11:17:55
【问题描述】:
我在 Delphi 10.4.2 中创建了一个全新的多设备应用程序。 使用此 Delphi 版本创建的应用程序应该可以在 Android 11 API LEVEL 30 中正常运行。
测试应用程序只是一个空表单,它没有实现任何东西,也没有做任何事情,它只是为了测试目的,因为我想找出我的真实应用程序没有运行的原因。
在谷歌上进行了一些挖掘之后,我做了一些测试,但没有一个找到的解决方案有效。
所有测试的结果都相同,它们是:
- 调试时,出现错误消息“运行 lib/gdbserver 时出错:无法在 0x8000 为 ...保留 655360 字节的地址空间”,然后应用关闭。
- 在不进行调试的情况下运行时,应用程序会在关闭 1 或 2 秒后启动,而不会显示任何消息。
我尝试使用 Delphi 10.4.2 默认 sdk 设置(Taregeting API 级别 29)构建应用程序,根据互联网上的一些消息,它应该可以工作。
我还安装了 android studio 并下载了 API 级别 30,并尝试使用它进行构建,也应该可以根据互联网上的其他帖子工作。
这是我用于测试应用程序的清单模板:
<?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) -->
我必须说,测试是在 Windows 64 位环境中使用 32 位官方 android 模拟器 API 级别 30 进行的。
这个模拟器镜像能够执行arm应用程序。
进行此测试的原因是所有升级到 android 11 的客户都抱怨上述情况。 (应用在几秒钟后关闭)。
在谷歌上尝试了所有解决方案都没有成功后,我不知道还能做什么。
有什么建议吗?
提前感谢。
【问题讨论】:
标签: android delphi-10.4-sydney