Apk won't install Android device

soykanozcelik

New member
Joined
Sep 10, 2024
Messages
1
Programming Experience
10+
Hi I've a dotnet MAUI project which is I'm developing it on VsCode for macOS.
I've installed all of necessary SDK's, JDK's, AVD, MAUI environments, extensions etc...
I've created keystore file via .NET MAUI - Archive / Publish tool (also created from vsCode Terminal or macOS terminal)
when I want to publish it Android selecting from command palette MAUI Archive : Publish Android, after selected keystore file + password O am getting a warning alias not found in keystore file then apk and build process seems success and its placed in release folder.

When i copy the signed apk file to the Android device and want to run/install it it won't install :/

After unsuccessful apk generation with extension that .NET MAUI - Archive / Publish tool, I've tried listed below which numbered 1..8

1
. I've created new keystore file via macOS terminal with below command

keytool -genkeypair -v \
-alias
permobil \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-keystore
"/Users/soykanozcelik/projects/androidkeystores/permobil.keystore" \
-storepass blabla \
-keypass blabla\
-dname "CN=soykan ozcelik, OU=devteam, O=cozbim, L=istanbul, ST=na, C=tr"

verified that keystore file like below
keytool -list -v -keystore "/Users/soykanozcelik/projects/androidkeystores/permobil.keystore"

2. clean and rebuild project in release mode from terminal (dotnet clean and dotnet rebuild)

3. build release with below command

dotnet publish -f net8.0-android -c Release \
-p:AndroidKeyStore=true \
-p:AndroidSigningKeyAlias=permobil \
-p:AndroidSigningKeyPass=blabla \
-p:AndroidSigningStorePass=blabla \
-p:AndroidSigningKeyStore="/Users/soykanozcelik/projects/androidkeystores/permobil.keystore" \
-p:AndroidPackageFormat=apk

4. added also timestamp ( IMHO this is no need self signed is enough ) with below command

jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
-keystore
"/Users/soykanozcelik/projects/androidkeystores/permobil.keystore" \
-storepass blabla \
-keypass blabla \
-tsa http://timestamp.digicert.com \
"/Users/soykanozcelik/Projects/PerMobilMaui/PerMobilMaui/bin/Release/net8.0-android/com.cozbim.permobil-Signed.apk" permobil

5. verified apk file with below command
jarsigner -verify -verbose -certs "/Users/soykanozcelik/Projects/PerMobilMaui/PerMobilMaui/bin/Release/net8.0-android/com.cozbim.permobil-Signed.apk"

and result :

jar verified.
Warning:
This jar contains entries whose certificate chain is invalid. Reason: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
This jar contains entries whose signer certificate is self-signed.
POSIX file permission and/or symlink attributes detected. These attributes are ignored when signing and are not protected by the signature.
The signer certificate will expire on 2052-01-27.
The timestamp will expire on 2031-11-10.

it seems OK and verified except warning

6. build process completed w/o error only was some warnings such "ex declared but never" used etc...

7. I've tested it on Android 9 device (Redmi Note 6 Pro, allowed unknown apps feature)

8. but apk wont't install on device

what is wrong?
where is wrong?
what is missing?
please help

PS-1 : I didn't tried yet to deploy apk release with cable to the android device, I'll try.
PS-2 : one of friend tried to install that apk file and said "I am getting 'There was a problem parsing the package'" error.
 
Back
Top Bottom