Why does my Android App freeze and can't deploy? - c#

I am using a MAC Book Pro and I wrote my Android App in Visual Studio using Xamarin in Parallels (virtual machine).
When starting the app, it builds, but then the "mobile screen" freezes and when I stop the application then I get two Error Messages:
-) Error ADB0010: Unexpected install output: cmd: Can't find service: package
-) Error ADB0000: Deployment failed
Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Can't find service: package
How can I fix this?
The App looks like this when I've started it

Try the below suggestions:
Make sure you have the latest Android Emulator version running.
Try a different Android version If you're using Visual Studio 2019 like me you have to go with Android 8.1 Oreo or higher.
3.Read this: StackOverflow Question

It normally caused by that the android emulator does not run well. Please check that you have installed all the emulator package.
After that, when I get this issue, I always stop the android device, in the device manager, edit to change the disk.dataPartition.size value to ‘5000M’(You could set the value according to your device.).

Related

Xamarin Android error XA0136 deployment errors

I am trying to deploy my Xamarin.Android application from visual studio to my smartphone which is Huawei P10. During compilation a popup shows up:
After you close the popup an error shows up:
Severity Code Description Project File Line Suppression State
Error XA0136: The 'run-as' command failed with 'run-as: package has corrupt installation: com.companyname.app1'.
The currently installation of the package in corrupt. Please manually uninstall the
package from all the users on device and try again. If that does not work you can disable Fast Deployment.
Fast Deployment can be disabled in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.
Tools and Devices used:
Visual Studio 2019 version 16.10.1
Xamarin Android
Deploy to Huawei P10 Android 9.0 API 28
Any suggestions pls on what is the problem.
Thanks
UPDATE: If you disable Fast Deployment works fine
According to Xamarin, you have to activate the developer mode for this. In addition, debugging via USB must be approved. You can find the exact statement here on GitHub. If you don't know how to activate the mode, you can find instructions here.
Alternatively, if all these steps did not work you can disable 'Fast development'. Either do this in your project or via Visual Studio.
Fast deployment is known to fail on devices which block run-as, which often includes devices older than Android 5.0. Fast deployment also fails for system applications (android:sharedUserId="android.uid.system") since run-as is also blocked for system applications.
If these solutions work let me know!
I also got this issue when trying to run the app in emulator. But I fixed it by changing to new android emulator

How to resolve unable to find device with the name: "Nexus 4 (Lollipop)" in xamarin

I have been battling with xamarine ide for a while now, I was unble to deploy my app to the emulator. Although I am a novice to xamarine IDE. The version am using is Xamarine Studio 6.3
pls I want someone to guide me here maybe I am missing something that did not allowed me to build an android app on Xamarine Studion Ide 6.3
These are the things I installed on my system to get started:
1. Xamarine Studio 6.3
2. Oracle vm virtual box (version 5.0.4)
3. Xamarine android player (XAP 0.6.5)
4. JDK 8
5. JTK for .NET (version 2.12.38)
Pls I really need your help if there is anything to install again so that I can get Xamarine IDE perfect for use to build an android app. Also if all what I have installed above are irrelevant, pls I need all the proper step here to get started. Thanks for your response.
Any device/emulator that is connected to your local instance of adb will show up in the Android Device List. If you are looking for a specific emulator such as Nexus 4(Lollipop), this was most likely provided in Xamarin Android Player or Visual Studio Emulator For Android. Both of these are now officially deprecated and removed from the default device list unless they are already running. Beforehand, they were added as default emulators that you could run straight from the Android Device List.
You can still run the emulators with their standalone programs to boot the emulators and they should appear on your device list as long as you can see them with the adb devices command.

Error while debug/deploy a Xamarin Windows Phone app on the device

I am starting develop on Xamarin.Forms Platform: I have installed it as Visual Studio's plugin. When i try to create a simple default project and then deploy it on the device (attached via USB) I obtain this message:
DEP4503: It has been installed the maximum number of app development.
These apps are installed on the device when I started in
Visual Studio or when using the deployment tool app.
Uninstall one of the app and try again. 0x-2130509543: Exception from
HRESULT: 0x81030119 HelloXamarin.WinPhone
But, I have not installed any app before! Is it 0 maximun number?!
P.S. I have a regular Developer Account. The device is unlocked for Developer Mode.
Thanks,
Regards!

Cannot debug Xamarin Android application in VS with ADB

I am trying to run the sample TipCalc Xamarin (Android) application in Visual Studio, however after it compiles and I run the Android emulator, I'm told the:
adb server version (32) doesn't match this client (36)
How do I fix this? I've updated Xamarin and the Android SDK files and Xamarin is correctly pointing to my android SDK location (D:\dev\Xamarin\AndroidSDK).
Here's a screenshot of my Android SDK manager:
Here's a bigger snippet of the output:
1>D:\dev\Xamarin\AndroidSDK\platform-tools\adb.exe -s 169.254.138.177:5555 devices
1>error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
1>List of devices attached
1>adb server version (32) doesn't match this client (36); killing...
1>could not read ok from ADB Server
1>* failed to start daemon *
1>error: cannot connect to daemon
1>
1>Selected device is not running.
1>Build FAILED.
Update: installing Android SDK Build-tools 24.0.3 (and removing 23.0.2) didn't help.
This answers provided at this this question don't help, as I don't know what Appium or Genymotion are, nor do I work with PHP. I agree though they are both caused by the android debugger, but I need the Xamarin fix.
The issue is you have another adb server running at the same time. When you install the Android SDK it installs a version of adb that Xamarin will use (in this case version 36), but some other tools also have adb installed with them. Some examples include Gennymotion and Appium as already mentioned, in my case it came as part of Mobizen which I was using for sharing the android device screen back to my Mac. You will have something installed which runs adb (version 32) causing the conflict.
What you'll need to do is locate the offending adb install and delete it. I'm assuming you are on windows so best to fire up task manager and have a look at the processes to find adb. Once you locate it you should be able to see what app it was installed from it's properties with based on it's path, so that you can uninstall it or delete it.

Why am I getting a "package could not be registered" deployment error on Windows 10 UWP?

I have an application targetted for Windows 10 and the UWP. The application correctly runs for x86 and x64 but when I try to run it on a mobile device targetting ARM on a Nokia Lumia 820 I get an error message during deployment:
DEP0001 : Unexpected Error: Package could not be registered. (Exception from HRESULT: 0x80073CF6)
There are other questions relating to this error that suggest it could be an issue with shared user certificates or that you can't have Audio and Device use in the same background task but I am not using either of these. There is also a suggestion that this may be due to a missing icon however to the best of my knowledge I am including far more icons than I actually need.
I have tried removing everything from my assets folder and removing it from the manifest but this also hasn't solved the problem.
Edit I've also tried creating a new blank universal project and that too runs on x86 and x64 but not on the mobile.
You have to run Windows 10 Mobile on your Lumia and you should at least have OS Version 10.0.10240.x. This will work with the release Version of Visual Studio 2015. If you have a CTP or Preview Version of Visual Studio, you should update them to release to get it running.
To get the preview onto the phone, you need the Windows Insider app on your phone and follow the instructions. Choose "fast ring" to get the latest bits.
http://windows.microsoft.com/en-us/windows/preview-download-phone
Get the app here:
https://www.microsoft.com/de-de/store/apps/windows-insider/9wzdncrfjbhk
This should make it work for you.
For more info on the current preview version check this link:
http://blogs.windows.com/bloggingwindows/2015/08/12/announcing-windows-10-mobile-insider-preview-build10512/

Categories