Jump to content
B See

Delphi 10.3.1 keep deploying corrupted apk

Recommended Posts

I am using Delphi 10.3.1. When I used the default (%minSdkVersion%, %targetSdkVersion%) in the manifest, the apk deployed was correct. However, when I change the two items to ("26", %targetSdkVersion … %), ("26","28"), ("28","28") or (%targetSdkVersion%, %targetSdkVersion%), the generated apk's are all corrupt. The only discernible info from the corrupted apk's are the checksums and the minSdkVersion info (using MyAPK tool). The Platform SDK's are the default ones that comes with Delphi. Please help! …

Share this post


Link to post
3 hours ago, B See said:

However, when I change the two items to ("26", %targetSdkVersion … %), ("26","28"), ("28","28") or (%targetSdkVersion%, %targetSdkVersion%

Can you be a bit more explicit about what you are actually changing? Preferably, show the before and after, even if it's the whole manifest.

Share this post


Link to post

BEFORE: <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="%targetSdkVersion%" />

I just change the two parameters for "uses-sdk" in the manifest. If I retain the values of (%minSdkVersion%, %targetSdkVersion%) , the resultant apk still show 4.4 kitkat as the minimum version and android P as the target SDK.

 

AFTER: <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="28" />  (1)

            <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="%targetSdkVersion%" /> (2)

            <uses-sdk android:minSdkVersion="%targetSdkVersion%" android:targetSdkVersion="%  targetSdkVersion%" /> (3)

            <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="28" />  (4)

When I change the pair of values to the 4 sets I listed above, the resultant apk is always corrupt

Share this post


Link to post

Correction:

BEFORE: <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />

Share this post


Link to post

I can further confirm that when the minSdkVersion ranges from 14 to 24, while the targetSdkVersion remains at 28, all the apk's were generated correctly. When minSdkVersion ranges from 25 to 28, while the targetSdkVersion remains at 28, all the 4 generated apk's were corrupt. This is quite baffling. Anyone with similar or different experiences?

Share this post


Link to post

What version of build tools are you using? i.e. in the Delphi SDK Manager, what is the path for example, for aapt.exe?

Share this post


Link to post

I am using the defaults as supplied with the Community Edition. These are the paths:
SDK:
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.33219.4899
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.33219.4899\build-tools\28.0.2\ZipAlign.exe
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.33219.4899\tools\Android.bat
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.33219.4899\platform-tools\Adb.exe
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.33219.4899\build-tools\28.0.2\Aapt.exe
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.33219.4899\platforms\android-26

NDK:
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-ld.exe
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-strip.exe
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\prebuilt\android-arm\gdbserver\gdbserver
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\platforms\android-19
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\platforms\android-19\arch-arm\usr\lib
C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\platforms\android-19\arch-arm\usr\lib;   C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.33219.4899\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a

Java:
C:\Program Files (x86)\Java\jdk1.8.0_192\bin\KeyTool.exe
C:\Program Files (x86)\Java\jdk1.8.0_192\bin\JarSigner.exe

 

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

×