question

NagarjunaGadikota-6994 avatar image
0 Votes"
NagarjunaGadikota-6994 asked mheralt answered

XA0137: The 'run-as' command failed with 'run-as: couldn't stat /data/user/0/com.test.demo: No such file or directory '.

Hi all,

My app not installing in release mode, Even I tried generating apk and installing but app is crashing every time.
I'm getting following error

Start debugging Android application failed
Start debugging Android application ...

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.test.demo/crc6409718adb1cab00c7.SplashActivity"
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test.demo/crc6409718adb1cab00c7.SplashActivity }

Error type 3
Error: Activity class {com.test.demo/crc6409718adb1cab00c7.SplashActivity} does not exist.

The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).

Additionally, check Build->Configuration Manager to ensure this project is set to successfully
for this configuration.
Start debugging Android application failed
dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please set MainActivity as MainLauncher = true, then generate a apk, if you have same issue.

0 Votes 0 ·

Hi @LeonLu-MSFT
Thanks for your response,
I'm getting this issue only for Andoid11 Devices only

I'm targeting to android11 also

0 Votes 0 ·
LeonLu-MSFT avatar image LeonLu-MSFT NagarjunaGadikota-6994 ·

Did you test it in android emulator? Is that worked?

0 Votes 0 ·

1 Answer

mheralt avatar image
1 Vote"
mheralt answered

I got this error while trying out a new MAUI project. My first deployment (through VS) went ok, and the application was functioning fine.
It's when I uninstalled the app manually from my device, and then tried to redeploy it with VS that I started to get this error.





XA0137: The 'run-as' command failed with 'run-as: couldn't stat /data/user/0/com.companyname.mauiappshell: No such file or directory





The only way that I could bypass this deployment error was to manually rename the ApplicationId from within the MAUI project file.

So, if your application id is like

 <ApplicationId>com.companyname.appname</ApplicationId>

rename it to something like

 <ApplicationId>com.companyname.1.appname</ApplicationId>

and try to re-deploy the app to your device.

Hope this will help!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.