question

Anas Azeem avatar image
Anas Azeem asked

Failure [INSTALL_FAILED_DEXOPT] error while sideloading app on Fire TV Stick with Lollipop

My app works fine when I install the app via Android Studio, but when I try to sideload the app using adb, I get the INSTALL_FAILED_DEXOPT error. I have tried many things like cleaning, invalidating etc. but everything failed.

This only happens on the Fire TV with OS version 5.2.2, contrarily on the latest Fire TV with Android 7.0, the app works absolutely ok.

Gradle version: 4.4
Android Plugin Version: 3.1.2
Build Tool Version: 27.0.3
minSdkVersion: 21
compileSdkVersion: 26
targetSdkVersion: 26

I am assuming this is the reason why my build isn't getting installed on the lollipop devices when I install the Live App Testing app.

Please let me know how to resolve this error.

fire tvlollipop
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anas Azeem avatar image
Anas Azeem answered

I was able to resolve the issue with following configurations:

  • Android Studio Version: 3.0.1
  • Gradle Version: 4.4
  • Android Plugin Version: 3.0.1

There is one caveat to this, only the signed APKs gets installed but all the debug APKs show the same error when installing.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for this. I am also seeing this issue. Installing debug variant fails, while signed release installs. The below dexopt error was in my debug install log, but I see that with the successful signed release install also. The debug variant installs on fire box ok.

dexopt flags broken, ignoring value of v=n,o=v,m=y in dalvik.vm.dexopt-flags

Gradle version: 4.4

Android studio: 3.1.2

Build tools: 27.0.3

minSDKVersion: 22

compile/target sdkVersion: 26

0 Likes 0 ·
Aim Tester avatar image
Aim Tester answered

The issue seems to lie, at least for me; in the gradle version. When i moved back from gradle 4.4 to 4.1 and set com.android.tools.build:gradle: to 3.0.1 i was able to install my application. This will suffice in the short term but this issue needs to be addressed.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks but that didn't help.

0 Likes 0 ·
methodsignature avatar image
methodsignature answered

I think this might be an issue with Android Gradle 3.1 (and up) D8 Dex compiler.

Disabling D8 allowed me to side load using Gradle 3.1. To do so, add the following to gradle.properties

android.enableD8=false

I didn't try on any higher Gradle version.

I'd suggest Amazon should try to fix for any potential future update to FireTV OS 5.x. (at least, I could not reproduce on a Nexus 4 running 5.1.1 - so my initial assumption is that this is a FireTV OS compatibility issue and not an issue with D8 itself).

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi methodsignature,

Thank you for your comments. Yes, we are aware of the changes related to the D8 Dex and the team is investigating that. Thanks!

2 Likes 2 ·

Just one other note. Looks like enableD8 is deprecated to be removed in AGP version 3.3. I received the following in my Gradle report:

Warning:The option 'android.enableD8' is deprecated and should not be used anymore.
Use 'android.enableD8=true' to remove this warning.
It will be removed in AGP version 3.3.

@Levon Great to hear someone is on this. Thanks!

0 Likes 0 ·
Sjoerd van Gestel avatar image
Sjoerd van Gestel answered

Update your android Gradle build tools to 3.1.3 (or higher to fix) resolved the issue for me

"com.android.tools.build:gradle:3.1.4"
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

This worked! Thanks.

0 Likes 0 ·