Bug 43241 - Android APK Deployment Failed - INSTALL_FAILED_DEXOPT
Summary: Android APK Deployment Failed - INSTALL_FAILED_DEXOPT
Status: RESOLVED DUPLICATE of bug 44633
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 6.0.2 (C6SR2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-08-10 17:33 UTC by ahmed
Modified: 2016-10-05 19:57 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
diagnostic build output (1.28 MB, text/plain)
2016-09-22 09:48 UTC, pinkelephantdev
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 44633

Description ahmed 2016-08-10 17:33:16 UTC
I'm using Xamarin.Android
Version: 6.1.2.21 (Xamarin Enterprise) & Xamarin Studio Enterprise
Version 6.0.2 (build 73)
Installation UUID: 3233f8fd-6268-4fc8-ac4c-479272650163



This is an urgent bug as it just started appearing in the week before releasing my Xamarin.Forms App for a client!! 

Issue: Attempting to compile and debug my Xamarin.Forms App on Android Devices or emulators results in the following:

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

Deployment failed. Internal error. "

NOTE THAT USUAL APK UNINSTALL WORKAROUND IS NOT WORKING:
===========================================
Normal workaround for Xamarin.Android APK deployment issues is to UNINSTALL the app from device/emulator using the Application Manager or using 'adb uninstall' -but In my case I am still gettting the 'Failure [INSTALL_FAILED_DEXOPT]' error despite all attempts to delete an exsisting app 

I also tried deleted the MONO Shared Runtime -this has NO effect

ANDROID LOG Of install error has more details:



D/AndroidRuntime( 3303): Calling main entry com.android.commands.pm.Pm
D/DefContainer( 1988): Copying /data/local/tmp/com.goodman.dttp-Signed.apk to base.apk
D/PackageManager(  565): Renaming /data/app/vmdl1804031113.tmp to /data/app/com.goodman.dttp-1
I/art     (  565): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@app@com.goodman.dttp-1@base.apk@classes.dex' for file location '/data/app/com.goodman.dttp-1/base.apk': Failed to open oat filename for reading: No such file or directory
I/art     (  565): DexFile_isDexOptNeeded failed to open oat file '/data/app/com.goodman.dttp-1/x86/base.odex' for file location '/data/app/com.goodman.dttp-1/base.apk': Failed to open oat filename for reading: No such file or directory
I/PackageManager(  565): Running dexopt on: /data/app/com.goodman.dttp-1/base.apk pkg=com.goodman.dttp isa=x86 vmSafeMode=false
I/dex2oat ( 3317): /system/bin/dex2oat --zip-fd=5 --zip-location=/data/app/com.goodman.dttp-1/base.apk --oat-fd=6 --oat-location=/data/dalvik-cache/x86/data@app@com.goodman.dttp-1@base.apk@classes.dex --instruction-set=x86 --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m
E/dex2oat ( 3317): Failed to open dex from file descriptor for zip file '/data/app/com.goodman.dttp-1/base.apk': Entry not found
I/dex2oat ( 3317): dex2oat took 202.219ms (threads: 4)
E/installd(   89): DexInv: --- END '/data/app/com.goodman.dttp-1/base.apk' --- status=0x0100, process failed
W/PackageManager(  565): Package couldn't be installed in /data/app/com.goodman.dttp-1
W/PackageManager(  565): com.android.server.pm.PackageManagerException: scanPackageLI
W/PackageManager(  565): 	at com.android.server.pm.PackageManagerService.scanPackageDirtyLI(PackageManagerService.java:5822)
W/PackageManager(  565): 	at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:5160)
W/PackageManager(  565): 	at com.android.server.pm.PackageManagerService.installNewPackageLI(PackageManagerService.java:9987)
W/PackageManager(  565): 	at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:10495)
W/PackageManager(  565): 	at com.android.server.pm.PackageManagerService.access$2300(PackageManagerService.java:231)
W/PackageManager(  565): 	at com.android.server.pm.PackageManagerService$6.run(PackageManagerService.java:8441)
W/PackageManager(  565): 	at android.os.Handler.handleCallback(Handler.java:739)
W/PackageManager(  565): 	at android.os.Handler.dispatchMessage(Handler.java:95)
W/PackageManager(  565): 	at android.os.Looper.loop(Looper.java:135)
W/PackageManager(  565): 	at android.os.HandlerThread.run(HandlerThread.java:61)
W/PackageManager(  565): 	at com.android.server.ServiceThread.run(ServiceThread.java:46)
Comment 1 Jonathan Pryor 2016-08-14 13:33:30 UTC
Does the .apk you're installing contain a `classes.dex` file? If it doesn't, that's probably the problem. If rebuilding the project doesn't fix that, please provide diagnostic build output.
Comment 4 pinkelephantdev 2016-09-22 09:44:08 UTC
I am getting the same error : INSTALL_FAILED_DEXOPT

I am using Xamarin Studio on a mac (6.1 build 5441)
I tried everything  like many people said in the forum about this but everything is not working.

I came back from my holiday, updated the Xamarin Studio( From version 5) and Xamarin.Forms( From version 2.3.0.107) and now it is not working anymore

Attachment of build provided
Comment 5 pinkelephantdev 2016-09-22 09:48:45 UTC
Created attachment 17669 [details]
diagnostic build output

I am getting the same error : INSTALL_FAILED_DEXOPT

I am using Xamarin Studio on a mac (6.1 build 5441)
I tried everything  like many people said in the forum about this but everything is not working.

I came back from my holiday, updated the Xamarin Studio( From version 5) and Xamarin.Forms( From version 2.3.0.107) and now it is not working anymore

Attachment of build provided
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-10-05 19:57:38 UTC
## Status update for users watching this bug

Based on Bug 44633, Comment 2 the behavior from Comment 0 matches the behavior of Bug 44633 when deploying to Android devices API 19 and lower.  A candidate fix for that bug has been created and is tentatively scheduled for release to a public updater channel within the next couple of weeks.

I will mark this bug as a duplicate accordingly.

*** This bug has been marked as a duplicate of bug 44633 ***