JohnLM 22 Posted August 26 Specs: Delphi XE7, FMX, Win7, Galaxy s10+ phone Android 12. I've have compile and deployed many apps over to my Android 12 device, galaxy s10+ phone. Earlier this year (2024) I stopped working on those projects I used to compile in this setup/specs (listed above). Today, I am trying to deploy an app and now I can not because of the 'Unsafe app blocked message'. I recall seeing something similar in late Dec/2023 on this phone, but there was a button to allow or not, and now I don't see that on this message screen given on my phone. How can I resolve this? Share this post Link to post
Dave Nottage 563 Posted August 27 2 hours ago, JohnLM said: How can I resolve this? It might help to provide the exact message. Is it one of these at this link? Share this post Link to post
JohnLM 22 Posted August 27 Yes, this one. . . I get that above message and then it closes on its own, and the app (this time) does not get installed. In previous deploying to my android 12 device, it would install but I would get a message similiar to above (not exact) but with the option to allow or uninstall--if memory serves me correctly. Share this post Link to post
Die Holländer 49 Posted August 27 Has it something to do with Android forces since June "MEETS_STRONG_INTEGRITY" of your device? https://developer.android.com/google/play/integrity/additional-tools#check-device Share this post Link to post
Dave Nottage 563 Posted August 27 2 hours ago, JohnLM said: I get that above message and then it closes on its own, and the app (this time) does not get installed. The info at that link literally tells you what the problem is, i.e: "Reason for this notification: These Play Protect warnings will show only if the app's targetSdkVersion is more than 2 versions lower than the current Android API level. For example, a user with a device running Android 13 (current API = 33) will be warned when installing any APK that targets API level lower than 31. Android Versions and corresponding API levels can be reviewed on the API level page." You would need to change %targetSdkVersion% in AndroidManifest.template.xml to a value less than 2 versions than the target device, i.e. in your case 29 (Android 10), 30 (Android 11), or 31 (Android 12). Not sure if this will work with XE7 - you might need to upgrade, preferably to Delphi 12. Share this post Link to post
JohnLM 22 Posted August 27 I've edited the "AndroidManifest.template.xml" file and changed the value in the %targetSdkVersion% field from 11 to 31 but when I re-build it (not deploy it), it is changed back to the default of 11. I did notice that there are several copies of the "AndroidManifest.xml" file in the Android folder of the project folder, and I have made the same changes, from 11 to 31. But the value reverts back to 11. I must be updating the wrong file somewhere. Are there steps that show how to excactly make the necessary changes where and when, etc. ? Share this post Link to post
Dave Nottage 563 Posted August 27 2 hours ago, JohnLM said: I've edited the "AndroidManifest.template.xml" file and changed the value in the %targetSdkVersion% field from 11 to 31 Most likely you did not edit AndroidManifest.template.xml then, because it does not have a value for targetSdkVersion, it looks like this: <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" /> More likely you edited AndroidManifest.xml which is generated in the project output folder. AndroidManifest.template.xml is in the root of the project source. Share this post Link to post
JohnLM 22 Posted August 27 (edited) post #8 I believe I am doing things correctly now. However, it is not working yet. See below for the XML file that I modified for Delphi XE7, and where I replaced the var android:targetSdkVersion="%targetSdkVersion%" with android:targetSdkVersion="31". <?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%"> <!-- This is the platform API where NativeActivity was introduced. --> <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="31" /> <%uses-permission%> <application android:persistent="%persistent%" android:restoreAnyVersion="%restoreAnyVersion%" android:label="%label%" android:installLocation="%installLocation%" android:debuggable="%debuggable%" android:largeHeap="%largeHeap%" android:icon="%icon%" android:theme="%theme%" android:hardwareAccelerated="%hardwareAccelerated%"> <!-- 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|keyboardHidden" 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%> <receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" /> <%receivers%> </application> </manifest> ...and when I compile/deploy to Android, it stops at this part: ...and Edited August 28 by JohnLM Share this post Link to post
Rollo62 539 Posted August 28 https://en.delphipraxis.net/topic/5763-android-project-deployment-messed-up/ https://stackoverflow.com/questions/62536901/problem-installing-delphi-10-4-android-sdk https://docwiki.embarcadero.com/RADStudio/Alexandria/en/E4103_Unable_to_create_process:_'message' Can you access device via adb (e.g. by list connected devices: adb devices -l)? Remove old app from devioce before new install? Enough memory on device to install? Share this post Link to post
Dave Nottage 563 Posted August 28 7 hours ago, JohnLM said: ...and when I compile/deploy to Android, it stops at this part: Once again, it is telling you the problem, i.e. that it is attempting to install the app with a different signature, and even suggests a solution, i.e. uninstall the original app. Share this post Link to post
JohnLM 22 Posted August 28 (edited) I started a new FMX project for android. I only added an edit box. I did not change the template xml file. I left it alone. Then I build it, and that was a success. Then, I compiled/deployed to android. Result: same issue as in post #8 above. I just don't understand it. This was working fine before, back in Dec/2023. And now I can't even compile a small editbox over to android. So frustrating. 😞 Edited August 28 by JohnLM typo Share this post Link to post
Lajos Juhász 295 Posted August 28 1 minute ago, JohnLM said: I just don't understand it. This was working find before, band in Dec/2023. And now I can't even compile a small editbox over to android. So frustrating. 😞 As it was mentioned earlier developing for mobile platforms is a moving target. In case of Android you have to follow the rules that Google sets every year. You cannot use the same tool for years like for Windows. 1 Share this post Link to post
Dave Nottage 563 Posted August 28 8 minutes ago, JohnLM said: Make me wish there was a Windows Phone. There were Windows Phones. If you want an environment where the development requirements are not going to change, that's probably your best option. 1 Share this post Link to post
JohnLM 22 Posted August 28 Success!! Okay. I figured out what was causing the problem. I need new glasses. I could not see the part about the link and clicked "Got it" which does not install. 1. So, I deleted the Android folder from the project folder. 2. Then, I restored a backup copy of the origianl unaltered "AndroidManifest.template.xml" file. 3. Compiled/deployed to android. 4. when a "Unsafe app blocked' message appears on the android phone, just above the large blue "Got it" button, click the "More details" link. 5. when you see additional details display, click on the "Install anyway" link. 6. enter your phones sign-on password 7. a dialog of security questions will appear, I just click the Continue button, bottom right. 8. another dialog box pops up for "look for updates.." and "ok". select OK button. 9. app will now load up. -- finished 2 Share this post Link to post