Help with new deployment issue for my Forms app - INSTALL_FAILED_DEXOPT - from xamarin studio

LesterMeeksLesterMeeks USMember ✭✭
edited September 2016 in Xamarin.Forms

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

Deployment failed. Internal error.

Haven't tried iOS in a while but this is targetting android, with a xamarin forms project in Xamarin Studio updated today. I have tried XAP Emulator, and real device, both seem to do the same thing.

«1

Posts

  • CuasiJoeCuasiJoe USMember

    Same here

  • grosygrosygrosygrosy FRUniversity

    Same issue for me

  • JimBennettJimBennett GBInsider, University, Developer Group Leader ✭✭✭✭

    I was seeing this, and got round it by enabling Multidex from the Android project options.

  • I am also seeing this.

    Enabling Multidex raised a new error:

    error : Tool exited with code: 10. Output: Error: Can't read [/Library/Frameworks/Xamarin.Android.framework/Versions/7.0.0-18/lib/xbuild-frameworks/MonoAndroid/v7.0/mono.android.jar] (Can't process class [android/app/ActivityTracker.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))

  • Same here

  • 15mgm1515mgm15 USMember ✭✭✭

    Disabling "Use Shared Mono Runtime" raised another issue:

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 (Dash.Droid)

  • LesterMeeksLesterMeeks USMember ✭✭
    edited September 2016

    For me, unchecking "shared runtime" seems to get me back on the road. Verified that the error comes back when reenabled.

    Edit: Actually. Unchecking shared runtime, doesn't seem to be required. The "Fast Assembly Deployment" option gets unchecked automatically when you uncheck shared runtime. And further investigation for me, show that I can deploy fine with "Use Shared Mono Runtime" checked, but "Fast Assembly Deployment" unchecked.

  • 15mgm1515mgm15 USMember ✭✭✭

    So at the end it was a combination of things:

    Update the Java JDK to 1.8.
    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    Disabling "shared runtime" and "Fast Deployment"

    Disabling Multidex

    Updating Android SDK Platform-tools 24.0.3 and the Android SDK tools to 25.2.2

    It is compiling very slowly but it is wokring

  • NateVargheseNateVarghese USUniversity ✭✭

    Turning off "Use Shared Mono Runtime" prevents you from using the Xamarin Android Player.

    That's no good.

  • LesterMeeksLesterMeeks USMember ✭✭

    @NateVarghese said:
    Turning off "Use Shared Mono Runtime" prevents you from using the Xamarin Android Player.

    That's no good.

    Really? I run XAP for most of my testing and am running without shared at the moment. What are you seeing that limits the use of XAP?

  • NateVargheseNateVarghese USUniversity ✭✭

    How is it that you can run XAP without the Shared Mono Runtime? I've always (now and even before this update) gotten "Architecture not supported" if it remains unchecked.

    Not sure when this came into play: "Note that the Xamarin Android Player has been deprecated. For more information, see the announcement in this blog post."
    Source: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/

    Perhaps now? I hate using the none XAP ones. They're so slow.

  • prashantvcprashantvc USXamarin Team Xamurai

    Can anyone send us a ADB log from the device/emulator when you hit this issue, please?

  • DanilDanil RUMember
    edited September 2016

    @prashantvc we have same problem. I think problem in bold lines.

    on Meizu m2 mini:

    Error (267) / installd: DexInv: --- END '/data/app/eu.ta.app-1/base.apk' --- status=0x0100, process failed
    Error (745) / WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 133 num clients 12
    Error (745) / WifiTrafficPoller: packet count Tx=81839 Rx=96006
    Error (745) / WifiTrafficPoller: notifying of data activity 0
    Error (745) / libPerfService: Could not open '/d/ged/hal/custom_boost_gpu_freq'
    Error (745) / libPerfService: error : 13, Permission denied
    Error (745) / WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 133 num clients 12
    Error (745) / WifiTrafficPoller: packet count Tx=81839 Rx=96006
    Error (745) / WifiStateMachine: ConnectedState (when=-4ms what=131155 arg1=33!CMD_RSSI_POLL 33 0 "Mobile Development" e0:3f:49:8e:61:e8 rssi=-58 f=2457 sc=60 link=65 tx=7,6, 0,0, 0,0 rx=5,5 bcn=0 [on:0 tx:0 rx:0 period:3003] from screen [on:0 period:760390886] gl hn u24 rssi=-53 ag=0 hr ticks 0,0,13 ls-=0 [56,56,60,60,65] brc=0 lrc=0
    Error (745) / WifiStateMachine: L2ConnectedState (when=-7ms what=131155 arg1=33!CMD_RSSI_POLL 33 0 "Mobile Development" e0:3f:49:8e:61:e8 rssi=-58 f=2457 sc=60 link=65 tx=7,6, 0,0, 0,0 rx=5,5 bcn=0 [on:0 tx:0 rx:0 period:3] from screen [on:0 period:760390889] gl hn u24 rssi=-53 ag=0 hr ticks 0,0,13 ls-=0 [56,56,60,60,65] brc=0 lrc=0
    Error (745) / WifiStateMachine: get link layer stats 0

    on Sony ZL:

    Warning (8322) / PackageParser: Unknown element under : uses-permission-sdk-23 at /data/local/tmp/eu.ta.app-Signed.apk Binary XML file line #63
    Warning (776) / PackageParser: Unknown element under : uses-permission-sdk-23 at /data/app/vmdl1551940663.tmp/base.apk Binary XML file line #63
    Error (10190) / dex2oat: Failed to open dex from file descriptor for zip file '/data/app/eu.ta.app-1/base.apk': Entry not found
    Error (393) / installd: DexInv: —- END '/data/app/eu.ta.app-1/base.apk' —- status=0x0100, process failed
    Warning (776) / PackageManager: Package couldn't be installed in /data/app/eu.ta.app-1
    Warning (776) / PackageManager: com.android.server.pm.PackageManagerException: scanPackageLI
    Warning (776) / PackageManager: at com.android.server.pm.PackageManagerService.scanPackageDirtyLI(PackageManagerService.java:6144)
    Warning (776) / PackageManager: at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:5451)
    Warning (776) / PackageManager: at com.android.server.pm.PackageManagerService.installNewPackageLI(PackageManagerService.java:10422)
    Warning (776) / PackageManager: at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:10965)
    Warning (776) / PackageManager: at com.android.server.pm.PackageManagerService.access$2300(PackageManagerService.java:249)
    Warning (776) / PackageManager: at com.android.server.pm.PackageManagerService$6.run(PackageManagerService.java:8831)
    Warning (776) / PackageManager: at android.os.Handler.handleCallback(Handler.java:739)
    Warning (776) / PackageManager: at android.os.Handler.dispatchMessage(Handler.java:95)
    Warning (776) / PackageManager: at android.os.Looper.loop(Looper.java:211)
    Warning (776) / PackageManager: at android.os.HandlerThread.run(HandlerThread.java:61)
    Warning (776) / PackageManager: at com.android.server.ServiceThread.run(ServiceThread.java:46)

  • prashantvc

    can you guys at Xamarin in the future check these things before making a release "Stable". I have the same issue had to switch off shared runtime on Android. Wasted a couple of hours again...

  • nmilcoffnmilcoff CHUniversity

    I've had the same problem and switching off shared runtime worked for me as well.

    Looking forward for an official explaination / fix

  • LushLush USMember ✭✭

    This is so frustrating...

  • Same problems here! Wasted whole day today until I found the shared runtime hack. A fix will be most welcome!

  • DanilDanil RUMember

    @prashantvc any news? we disable shared runtime but its hack not work for us.

    Note: solution build fine in release, error INSTALL_FAILED_DEXOPT rised only in debug.

  • prashantvcprashantvc USXamarin Team Xamurai

    @Danil we are still investigating the issue. I will talk to engineering team and keep you updated here

  • DanilDanil RUMember

    @prashantvc ok, thank you!

  • rizkyariorizkyario USMember ✭✭

    This solved my problem,
    Thanks!

    @15mgm15 said:
    So at the end it was a combination of things:

    Update the Java JDK to 1.8.
    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    Disabling "shared runtime" and "Fast Deployment"

    Disabling Multidex

    Updating Android SDK Platform-tools 24.0.3 and the Android SDK tools to 25.2.2

    It is compiling very slowly but it is wokring

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai
    edited September 2016

    Hi All,

    I'm seeing a couple of different errors in this thread. I'd like to help you all through them.

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

    This typically happens when the .apk you are creating does not contain a classes.dex file. Please ensure that Xamarin.Android is generating this file in your obj\Debug\android\bin folder. Simply open it up in a text editor to ensure it's not blank(It will be unreadable FYI)

    Secondly, please try to uninstall the Xamarin.Android Shared Runtime and your application from your device/emulator. You can then try to deploy it with the Shared Runtime enabled. (Default Settings)

    There is a bug tracked here: https://bugzilla.xamarin.com/show_bug.cgi?id=43241

    (If you continue to run into this bug, please attach a diagnostic build output to a bugzilla comment) -https://forums.xamarin.com/discussion/27515/how-to-obtain-diagnostic-build-logs (XS) and http://blogs.msdn.com/b/msbuild/archive/2005/09/29/475157.aspx (VS)

    2) java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0

    There are two parts to this:

    1) Using JDK 1.7 instead of JDK 1.8 (Please update to JDK 1.8)

    2) Having an old version of proguard.jar that the Android SDK ships by default which doesn't support JDK 1.8.

    Here is a SO answer on this question: http://stackoverflow.com/questions/39514518/xamarin-android-proguard-unsupported-class-version-number-52-0/39514706#39514706

    This is being tracked here: https://bugzilla.xamarin.com/show_bug.cgi?id=44187

    (If you continue to run into this bug, please attach a diagnostic build output to a bugzilla comment) -https://forums.xamarin.com/discussion/27515/how-to-obtain-diagnostic-build-logs (XS) and http://blogs.msdn.com/b/msbuild/archive/2005/09/29/475157.aspx (VS)

  • BrightLeeBrightLee KRMember ✭✭✭

    @JonDouglas
    Hi,
    It does not even make "classes.dex" file.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    @BBright

    Can you please ensure you are on the latest version of build-tools inside your Android SDK Manager? If you have previous versions of build-tools installed, please delete them and install 24.0.2.

    Secondly, if you have a reproduction that you can upload this to forum post or direct message me a link to download, that would help tremendously!

    Thanks!

  • BrightLeeBrightLee KRMember ✭✭✭

    @JonDouglas
    Hi, I tried what you said and set to use ver24, but result is same.
    Still there is no "classes.dex" file.

    I tried what @15mgm15 mentioned.
    And It works.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai
    edited September 2016

    @BBright

    Try to also reinstall the Mono Shared Runtime and your Application by removing them using adb uninstall <package name>.

    You can use adb shell pm list packages to view all the packages installed.

    FYI: The mono runtime package name should be called Mono.Android.DebugRuntime

    Otherwise you can use the Applications settings screen to uninstall these apps.

    If this still does not work, please feel free to provide a reproduction so I can investigate further.

  • BrightLeeBrightLee KRMember ✭✭✭

    @JonDouglas
    I tried it and found Mono.Android.DebugRuntime.
    I deleted it and result is same.

    I will send my project to you.

    But I have question, If I don't use Mono shared runtime (uncheck) it works.
    What's the difference?

    It's little bit slow to compile but seems OK.

  • RonFreschiRonFreschi USUniversity ✭✭

    Tried everything in this thread multiple times but am still seeing the INSTALL_FAILED_DEXOPT error for debug and release builds.
    Turning off the shared mono runtime for debugging is not really a viable option even if it was working because builds are painfully slow.

    Any xamarin solution yet?

  • Shane000Shane000 USMember ✭✭✭

    I've tried everything in this thread, still getting INSTALL_FAILED_DEXOPT on a factory reset emulator in XAP and Architecture is Not Supported if I try and turn off shared runtime.

    I updated java.
    I set build tools to 24.0.2 and uninstalled all other build tools.

    I get the crash on XAP and maybe google emulator but i can barely get that to work at all.

    Deprecating XAP screws over mac developers as Google's emulator is insanely slow. But I'm sure that comes with the microsoft acquisition.

  • @ShanePope said:
    I've tried everything in this thread, still getting INSTALL_FAILED_DEXOPT on a factory reset emulator in XAP and Architecture is Not Supported if I try and turn off shared runtime.

    I updated java.
    I set build tools to 24.0.2 and uninstalled all other build tools.

    I get the crash on XAP and maybe google emulator but i can barely get that to work at all.

    Deprecating XAP screws over mac developers as Google's emulator is insanely slow. But I'm sure that comes with the microsoft acquisition.

    I did the same and still getting the same errors on Xamarin Studio on my mac.
    Can't use the simulator for Android anymore at this point!

  • GizmoGizmo CLMember
    edited September 2016

    Any workarounds??. Can't test on my Android simulator anymore (using XAP) after updating Xamarin

    Update: I tried my physical device, and the same error: Deployment failed because of an internal error: Failure [INSTALL_FAILED_DEXOPT]

  • LesterMeeksLesterMeeks USMember ✭✭

    Check to see if you have the x86 architecture enabled on debug builds.

  • LesterMeeksLesterMeeks USMember ✭✭

    I had to make sure to uncheck "Shared Mono Runtime", and also make sure that x86 is in the supported list to get the debugger to not error on deployment everytime now. I have attached pics of my build, and I am currently using it to debug on XAP.

  • LesterMeeksLesterMeeks USMember ✭✭
    edited September 2016

    As far as the crashing on startup. I don't recall exactly what was going on, but once a while back I think I remember a thread on the android forum that mentioned that you should keep 23.0.3 SDK tools around. So I keep them around and things seem to work more reliably. Here is my SDK install setup right now.

  • LesterMeeksLesterMeeks USMember ✭✭

    Min Android Version is 15, and Target Android version is "automatic" but says that it is using API 23 (since I think that is the only one I have installed.) If you want to see anything else about my project or tool setup let me know.

  • RonFreschiRonFreschi USUniversity ✭✭

    Not using XAP anymore because I'm supporting API 19 - 23, targeting 23, and shortly 24. It's probably old news but they are not going to release any new versions or sims for XAP.
    Using only android sims now and have had the best luck with the "Google APIs Intel x86 Atom System Image"

  • GizmoGizmo CLMember
    edited September 2016

    @LesterMeeks said:
    I had to make sure to uncheck "Shared Mono Runtime", and also make sure that x86 is in the supported list to get the debugger to not error on deployment everytime now. I have attached pics of my build, and I am currently using it to debug on XAP.

    Thank you, it works for me, but i had to change the version of my XAP machine, cause with API 19 was not working. It does work with Api 22, hope it helps others too

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Hi Everyone,

    Sorry for the late response as I have been investigating this issue. I have found one of the major causes for this issue which I believe is the classes.dex file is not deploying with the base.apk if the Shared Runtime is enabled. I have collected all of this information in the following bug report which has been passed off to our engineering teams to investigate further:

    https://bugzilla.xamarin.com/show_bug.cgi?id=44633

    Please feel free to CC yourself to this bug to get updates.

«1
Sign In or Register to comment.