Share via

Xamarin.Forms Not found MainActivity for Android 8 API 28

Denis Creator 196 Reputation points
2021-08-14T22:59:18.307+00:00

Hi everyone,

Faced with the issue on Android 8 API 26 with the following error during deploy of application:

Detecting existing process

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.App/crc64d9c3a76b38d59d78.MainActivity"
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.App/crc64d9c3a76b38d59d78.MainActivity }

Error type 3
Error: Activity class {com.companyname.App/crc64d9c3a76b38d59d78.MainActivity} does not exist.
Failed to launch android application

I use Xamarin.Forms 5.0

Does anybody faced with such issue ?
How to fix it ?
Application works properly on Android 9 and above ...

Today I also found that always after installation I see the following logs:

2021-08-15 09:09:45.136 832-1211/? V/HwPackageManagerService: POST_INSTALL: pkgName = com.companyname.App, pkgUri = /data/app/vmdl204364668.tmp;, pkgInstalledPath = /data/app/vmdl204364668.tmp, pkgInstallerPackageName = , pkgVerName = 1.0, pkgVerCode = 1, resultCode = 1, pkgUpdate = false, pkgMetaHash = 086776b2ea1bb56e372d0c3213103078cedc07b05747a62cec55f7dbb9b6b891
2021-08-15 09:09:45.136 832-1211/? W/ActivityManager: Skipping broadcast of Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.App flg=0x4000010 (has extras) }: user 10 is stopped
2021-08-15 09:09:45.145 10763-10763/? I/Pm: Package com.companyname.App installed in 3038 ms
2021-08-15 09:09:45.147 832-5958/? W/System.err: java.lang.SecurityException: Caller has no access to session 204364668
2021-08-15 09:09:45.147 832-5958/? W/System.err: at com.android.server.pm.PackageInstallerService.abandonSession(PackageInstallerService.java:774)
2021-08-15 09:09:45.148 832-5958/? W/System.err: at android.content.pm.IPackageInstaller$Stub.onTransact(IPackageInstaller.java:97)
2021-08-15 09:09:45.148 832-5958/? W/System.err: at android.os.Binder.execTransact(Binder.java:675)
2021-08-15 09:09:45.151 10763-10763/? I/app_process: System.exit called, status: 0

123289-install-issue0.log

Developer technologies | .NET | Xamarin
0 comments No comments

Answer accepted by question author
  1. Denis Creator 196 Reputation points
    2021-08-15T08:48:52.063+00:00

    I have found the answer how to fix the issue ...

    This question helped me https://stackoverflow.com/questions/47708240/missing-component-mainactivity-xamarin-android

    By some reason this application was already installed on device, but pm list packages did not show it

    ... but when I've run command .\adb.exe uninstall com.companyname.App it returned Success meaning that some packages was installed ... Second run of this command returns the error, which meant that I was right ...

    And application starts working after this !!

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.