1

I'm building an application with Xamarin, but when trying to run it on this (physical) device (Wiko Enspert Rainbow) in Debug mode, the installation fails with a "Deployment Failed - INSTALL_FAILED_DEXOPT" error.

I get the following log in "Deploying to device" window :

Deploying package to '0123456789ABCDEF'

Detecting installed packages

Waiting for packaging to complete

Installing application on device

Deployment failed because of an internal error: Failure [INSTALL_FAILED_DEXOPT]

Deployment failed. Internal error.

In Release, the installation works. Also, I have enough space on the phone.

I've tried to remove Mono Shared Runtime, and Xamarin.Android Api-23 support lib (as well as obviously the Release version of the app). Tried to clean and rebuild ; reboot the phone... to no avail.

Does anyone have an idea ?

Thanks

Eino Gourdin
  • 4,169
  • 3
  • 39
  • 67
  • Possible duplicate of [how to solve INSTALL\_FAILED\_DEXOPT this error?](http://stackoverflow.com/questions/5153515/how-to-solve-install-failed-dexopt-this-error) – Gerald Versluis Sep 14 '16 at 14:37
  • @Gerald, basically the advices on that page are either to clean and rebuild, or to disable "instant run" (not available on xamarin android). – Eino Gourdin Sep 14 '16 at 14:45
  • The answer on that question is to wipe the user data from the emulator. Did you try to remove the app from the device/emulator? And not just throw away the icon but also go to add/remove programs in your Android and _really_ delete the app and all data – Gerald Versluis Sep 14 '16 at 14:47
  • Well, yes, I wrote I uninstalled Mono & Xamarin.Android support library, I thought needless to say I did the same with the Release version. – Eino Gourdin Sep 14 '16 at 14:52
  • That's not what he meant. Try to reinstall/reconfigure your emulator. – greenhoorn Sep 14 '16 at 14:52

2 Answers2

4

I could "solve" the problem by deactivating "Use Shared Mono Runtime" (in Options -> Android Build -> General).

However it makes the install quite slow. There is probably a better solution somewhere.

Eino Gourdin
  • 4,169
  • 3
  • 39
  • 67
4

I dont know if this is your case but I was able to fix this by removing this 3 nuget packages from my project

Microsoft.Net.Http
Microsoft.Bcl
Microsoft.Bcl.Build

and reference Net.Http lib via References-All-System.Net.Http

  • 1
    I got this error when activating "Use shared mono runtime" for faster installs. Removing the `Microsoft.Bcl` packages worked for me. Although, I get warnings in the build console telling me to install theses packages, but I have no idea why this is "required". The application still works without them - so the warnings is ignored, for now. – JAM Oct 20 '16 at 13:43