I'm building a Xamarin app, and, so far, I've been able to build without issue on the iPhone Simulator, but I haven't been able to get the app to launch successfully on a physical iPhone device. In the past (about a month ago), the app was working fine on the same device. Here's some background on the specifics:
I develop my Xamarin code on my Windows machine, which is linked a remote Mac (hosted by MacStadium, a third-party hosting service).
My test phone is an iPhone 5c running iOS 10.3.3
To deploy to my iPhone, I build my app in Release mode in Visual Studio, upload the code to a third-party app installation service, Installr, which hosts the IPA file and assists with the installation of my app on the physical device. I've never had an issue with Installr and have no reason to believe that this is the source of my problem.
Since the last time the app worked on the physical device, I updated Visual Studio to version 16.3.2 and updated Xamarin. Here's the Xamarin Specs:
Generally, what happens, is that I download and install my app on the iPhone without any issue. However, when I click on the app, the splash screen loads for about 5 seconds, a white screen briefly appears as follow, then the app crashes.
I've seen several related articles on StackOverflow and other sources on the internet, but none of the proposed solutions see to work for me. For example, I've tried adding [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
to App.xaml.cs with no luck.
I've also played around with changing the CSProj file settings to compile for various combinations of ARM64 and ARMv7. Changing this didn't help either. I've tried changing the linker behavior to "Don't Link" from "Link Framework SDKs Only", and I get an error message stating that the native code is too large for 32-bit architectures. I would compile for only 64-architectures to get around this error, but I believe that the iPhone 5c uses a 32-bit architecture.
Here's what my iOS Project's CSProj file looks like currently. I've tried checking just about all of those checkboxes with no luck:
I'm stumped as to what this could be. Any suggestions would be greatly appreciated. To further complicate things, I haven't been able to get a good log file from the iPhone. Since the Mac is remotely hosted, I can't plug my phone into XCode to pull the logs that way. Does anyone have a reliable solution to get log files another way?
It looks like upgrading solved the problem. Visual Studio was updated to Visual Studio to 16.3.5 from 16.3.2. XCode on my Mac was updated to Version 11.1. After these updates, Visual Studio performed an update while connecting to the Mac remotely.
I have 3 self-written apps on my phone. 2 written with Xamarin.Android and one written with Xamarin.Forms. But there is a big problem. It always work only 2 or 1 app depending on which of the 3 apps was installed last. If one of the two Xamarin.Android apps was installed last, then both Android apps work. The Forms App, however, crashes immediately. Same the other way around. If the Forms app was installed last, it works fine. The two Android apps crash immediately.
Is there any reason for that? Are the frameworks not compatible?
I had the same problem trying to install the apk from Debug folder.
Steps that worked for me:
- Disable "Use Shared Runtime"
- In Advanced Settings, Select supported architecture
Check the screenshot if not clear
If you are deploying a debug apk into the same device, with different Runtimes, when the apk is installed will remove the previous / override. So, you will need to: disable Shared Runtime, or make sure the dependencies are all the same in all the applications
If you are using visual studio then Check "Application output" with release on device.
In Application Output you can see if any exception is causing problem..
I have Windows 8.1 pro with an AMD processor. I installed the Android SDK and Eclipse. It works but the problem is that when I Create AVD and launch it shows this error:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
I have already installed Intel Hardware_Accelerated_Execution_Manager and I have enabled Virtual modulation from the boot menu, but it's still not working.
Make sure you have installed HAXM installer on your SDK Manager.
After you download it and make sure you run the setup located in:
{SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
Note: in Android Studio, the command "intelhaxm.exe" has been changed to "intelhaxm-android.exe"
If you get the error "VT not supported" during the installation disable Hyper-V on windows features. You can execute this command dism.exe /Online /Disable-Feature:Microsoft-Hyper-V. You will also need "Virtualization Technology" to be enabled on your BIOS
Open SDK Manager and download Intel x86 Emulator Accelerator (HAXM installer) if you haven't.
Now go to your SDK directory (C:\users\username\AppData\Local\Android\sdk, generally). In this directory, go to extras → Intel → Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe".
In case you get an error like "Intel virtualization technology
(vt,vt-x) is not enabled", go to your BIOS settings and enable
hardware virtualization.
Restart Android Studio and then try to start the AVD again.
It might take a minute or 2 to show the emulator window.
If you're running Mac, as #pedro mentions ensure you have the HAXM installer dowloaded via the Android SDK Manager.
Next install it! In finder navigate to /YOUR_SDK_PATH/extras/intel/Hardware_Accelerated_Execution_Manager/
Run and install the .mpgk in the following .dmg
Yosemite: IntelHAXM_1.1.0_for_10.10.dmg
Pre-yosemite: IntelHAXM_1.1.0_below_10.10.dmg
El Capitan: IntelHAXM_6.0.1.dmg - please install the IntelHAXM_6.0.1.mpgk file within - it will ask you if you want to reinstall it. Just say yes.
Example:
$cd /YOUR_SDK_PATH/extras/intel/Hardware_Accelerated_Execution_Manager/
$open IntelHAXM_1.1.0_below_10.10.dmg
First, you must enable Intel virtualization technology from the BIOS:
Second, navigate to your SDK ...\extras\intel\Hardware_Accelerated_Execution_Manager:
Then install intelhaxm-android.exe.
Note that if you can't find this file in the directory, make sure you install the package from your SDK manager:
This resolves it for me:
Go to (C:\users\%USERNAME%\AppData\Local\Android\sdk, generally).
Then go to Extras -> Intel -> Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe".
In case you get an error like "Intel virtualization technology (vt,vt-x) is not enabled", go to your BIOS settings and enable Hardware Virtualization.
Restart your studio
For AMD processors:
You don't need Genymotion, just create a new Virtual Device and while selecting the system Image select the ABI as armeabi instead of the default x86 one.
I faced the same problem recently.
I installed the HAXM installer on your SDK Manager:
And then installed the latest Intel HAXM driver:
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement
And voila!!! The emulator works like a charm :)
For AMD processors:
Go to AVD manager and create a new virtual device as an ARM system image.
So I am having this issue and it seems that unless you are on Linux you will not be able to use HAXM. [EDIT: this is if you have an AMD chip (non intel) of course as that is the issue]
As stated on the Android Site;
Many modern CPUs provide extensions for running virtual machines (VMs)
more efficiently. Taking advantage of these extensions with the
Android emulator requires some additional configuration of your
development system, but can significantly improve the execution speed.
Before attempting to use this type of acceleration, you should first
determine if your development system’s CPU supports one of the
following virtualization extensions technologies:
Intel Virtualization Technology (VT, VT-x, vmx) extensions
> AMD Virtualization (AMD-V, SVM) extensions (only supported for Linux)
As others have mentioned Genymotion may be a solution.
I waste too much time on this, and none of the previous answers work. I find that Avast is the issue!!! If you have Avast installed in your system, you have to:
Go to settings tab --> troubleshooting, then you should UNCHECK the
"enable hardware-assisted virtualization"
Restart your PC and install the intelhaxm-android.exe if it is not installed. You can find it in C:\Users\{YOUR USERNAME}\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager
For those who are using Android Studio based on Jetbrains:
Goto Tools > Android > SDK Manager
Under Extras --> select the checkbox Intel x86 Emulator Accelorator
For those who are unable to use Nexus AVD can also try using Generic AVD.
Goto Tools > Android > AVD Manager
Then create a new Genreic AVD with something like QVGA and use for your app. This AVD does not use hardware acceleration.
I was facing this issue running the emulator inside Oracle VirtualBox. For me the solution was to modify the emulator to use an ARM CPU instead of x86.
You need to read (and post) the output of
sc query intelhaxm
as stated on http://developer.android.com/tools/devices/emulator.html#accel-vm
You open a command prompt window by right click on the start menu, choose execute and write 'cmd'.
See also Android Emulator Doesn't Use HAXM .
If you cannot get the emulator to work you might want to try out an easier alternative: Genymotion - http://genymotion.com/
First of all you should have Virtualization Enabled and you can do it from BIOS setting.
After that go to Control Panel\Programs and Click on "Turn Windows features on or off" option.
You will now have a pop up window, spot "Windows Hypervisor Platform" and enable it by checking the check box.
Restart your PC and now AVD should work without any issue.
For Android Studio 1.0.2:
First make sure Intel x86 emulator accelerator is installer. Check it in your SDK Manager. If not, then install it from there.
Go to your Android SDK folder,
**{SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager**
There you will find silent_install.bat.
Run it. It will create haxm_silent_run.log. After that, close and restart your Android Studio and then run your app.
It will work. In case of a problem, check the haxm_silent_run.log file.
As many other pointed out, Intel HAXM only supports Intel CPUs. Since Windows 1804 you can use Microsoft's Hyper-V instead of HAXM for the emulator. This also helps people who want to use Hyper-V for virtual machines as you need to disable hyper-v to run haxm.
Short version:
install Windows Hypervisor Platform feature
Update to Android Emulator 27.2.7 or above
put WindowsHypervisorPlatform = on into C:\Users\your-username\.android\advancedFeatures.ini or start emulator or command line with -feature WindowsHypervisorPlatform
enable IOMMU in your BIOS settings
Long version with more details:
https://blogs.msdn.microsoft.com/visualstudio/2018/05/08/hyper-v-android-emulator-support/
Requirements docs:
https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/system-requirements-for-hyper-v-on-windows
While creating a Virtual Device select the ARM system Image. Others have suggested to install HAXM, but the truth is haxm wont work on amd platform or even if it does as android studio does not supports amd-vt on windows the end result will still be a very very slow emulator to run and operate. My recommendation would be to either use alternative emulator like Genymotion (works like a charm with Gapps installed) or switch to linux as then you will get the benefit of amd-vt and emulator will run a lot faster.
I don't know if this is going to work but you can try this:
It's becoming pretty clear that the emulator team needs to do a better job of disseminating this information about how to use the emulator on AMD on Windows. This question comes up every week it seems.
First, uninstall HAXM.
Next, go here - https://developer.android.com/studio/run/emulator-acceleration#vm-windows and follow the instructions for Configuring VM acceleration with Windows Hypervisor Platform
Finally, if you get low framerates in your emulator instances, follow the instructions in the same page for Enabling Skia rendering for Android UI.
In my case, HAXM was already installed in SDK Manager. But every time I attempted to intelhaxm-android.exe, it would silently fail.
Finally, I extracted the internal installers out of intelhaxm-android.exe in 7-zip. Copied the three files to another directory and finally got a real installer to run. Ran without a hitch and HAXM issues were gone.
Every time I try to add the Interactive Brokers API control on my computer it gives me an error that sais....
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. (Exception from HRESULT: 0x800736B1)
I have been looking for an answer and trying different things for a week now and I can not seem to figure it out. I tried it on my laptop and it worked. I thought it was my windows or my visual studio so i re-installed everything on my PC. I'm not running a Windows 7 Professional x64 with Visual Studio 2013 with the newest update. At this point I have no idea what to try to make it work. Does anybody know what is this error.
Sorry-very late for an answer to this but in case someone else comes across it. There are a number of reasons why Visual Studio might not be able to add the control to your application. For 64-bit windows, one of the main issues is that the ActiveX control (tws.ocx) is not registered properly when the API is installed. I have a web page dedicated to installing IB API on Windows and I list out many of the issues that can happen when working with the ActiveX control on 64-bit windows: http://holowczak.com/ib-install/
I just posted a very simple tutorial on my website that starts at the very beginning and walks you through getting the API to work with interactive brokers using Visual Studio and C# : Get Real-Time Stock data from Interactive Brokers API
If that doesn't help I would consider:
Turn off Windows Firewall and give it a try.
Ensure you have Traders Workstation setup to allow incomming connections for ActiveX/.NET.
Ensure Traders Workstation works on your machine. Try downloading it from IB and launching it. If it works, then the problem is on the .NET or connection from .NET to TWS which is Java.
Also when you say "Interactive Brokers Control" do you mean the API package that you can download? If so to build it into your program all you need is the .DLL file as shown in the tutorial link I posted above.
When I try to run my Mono C# programs in MonoDevelop on an external console, I get the following error.
http://i146.photobucket.com/albums/r248/bobber205/error.jpg
(First time needing to post a pic here on stackoverflow, sorry if this isn't correct to just post a link)
:)
It runs on windows's regular "cmd" console when I debug with input working as well.
I've tested an older version of mono and this feature worked. (Note I get this error on both Windoows Vista, Windows 7, and Mac OS X).
Any ideas on how to give it that "filename"? I thought maybe beta 2 would fix this but I guess not. :P
I'm pretty sure that MonoDevelop uses xterm & bash for the "external console", which won't work on Windows, and might have problems on Mac. It needs to be abstracted out to use native consoles for these different platforms.
Please file a bug: http://monodevelop.com/Developers#Reporting_Bugs